If an app or a website form sends a record with training=true then the record is saved with a training flag, which is correct behaviour, even if the user account on the hosting website (ie irecord) does not have that mode turned on. This allows to turn on the training mode per form/app which is great. But it doesn't work vice versa.
The problem lies when an app or anything else that submits a record through the hosting site without a training flag and that record is flagged as training because of the mode on the hosting site. So now a user using iRecord website with a training mode on and the iRecord App with a training mode off, sends all the records from the app as if they were training ones, which it shouldn't.
I think it would be more correct if the hosting site had a training flag on every form generated (hidden) and not the warehouse going to fetch it after it receives a record.
I think this is the line that does that:
|
if ($entity==='occurrence' && function_exists('hostsite_get_user_field') && hostsite_get_user_field('training')) |
If an app or a website form sends a record with training=true then the record is saved with a training flag, which is correct behaviour, even if the user account on the hosting website (ie irecord) does not have that mode turned on. This allows to turn on the training mode per form/app which is great. But it doesn't work vice versa.
The problem lies when an app or anything else that submits a record through the hosting site without a training flag and that record is flagged as training because of the mode on the hosting site. So now a user using iRecord website with a training mode on and the iRecord App with a training mode off, sends all the records from the app as if they were training ones, which it shouldn't.
I think it would be more correct if the hosting site had a training flag on every form generated (hidden) and not the warehouse going to fetch it after it receives a record.
I think this is the line that does that:
client_helpers/submission_builder.php
Line 268 in 4577dac