Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importer - "Lookup of existing records" option not correctly looking up existing records under certain circumstances #476

Open
andrewvanbreda opened this issue Apr 18, 2023 · 1 comment
Labels

Comments

@andrewvanbreda
Copy link
Contributor

There are problems with the importer and the use of the "Lookup of existing records" option when a supermodel is used.

The problem became apparent during an import which required a list of latin names in one column, then a list of Swedish names to be added as translations in another column.

If we then use the "Lookup of existing records" option in the importer we start running into difficulties.
For instance, when I used the "Species list and taxon name" option, this would cause very problematic results.

The problem is that the code does not work very well if supermodels are present.
In our example above, the importer model is taxa_taxon_list, but actually the field we are mapping to lookup existing names against is taxon:taxon.

When looking up existing records the importer needs to create a join to then taxa database table. This is not handled very well and at the moment relies on special cases built into the function "buildJoin" in the import.php file.
Previously this included a couple of special cases to handle external_key/search_code lookups, as a workaround a special case for taxon name has now been added.
However this code needs generalising so broken cases cannot occur.

@andrewvanbreda
Copy link
Contributor Author

Note that the code has been patched to handle using the Species Name and Species List option, but it is possible other failures may occur.
The Parent, Species Name and Species List option is untested at time of writing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant