Indicia-Team / warehouse

GNU General Public License v3.0
5 stars 3 forks source link

Cannot set verifier during occurrence import #451

Closed JimBacon closed 1 year ago

JimBacon commented 2 years ago

Create a CSV file with columns for date, taxon, grid ref, and verified by. Populate a row with a record having a valid date, a taxon known to be in a list, a valid grid reference and the username known to be in the user table. Upload the file at http://<warehouse_base_url>/index.php/occurrence. When selecting the settings, use Accepted as the record status and then map the verified by column to Occurrence: verified by (from controlled termlist) It hits this code https://github.com/Indicia-Team/warehouse/blob/61f4cb321faf25b10b227fbdefa22bb5d46bc49e/application/models/occurrence.php#L139-L144 with the upshot that the verifier in the CSV file is overwritten by that of the person conducting the upload.

Repeating the process but setting the record status to <Please select> allows the code to follow another execution path whereby the verifier is set from the CSV file but the record status defaults to 'C'. This is an invalid state as it combines a verifier with a status indicating that the record is unchecked.

JimBacon commented 1 year ago

As well as over-writing imported values for Occurrence: verified by (from controlled termlist), so, too, are Occurrence: verified on values.