Opened 14 years ago

Closed 14 years ago

#1608 closed defect (fixed)

batch importer fails on item already exists but it should not

Reported by: Jari Häkkinen Owned by: everyone
Priority: major Milestone: BASE 2.17.2
Component: coreplugins Version: 2.17
Keywords: Cc:

Description (last modified by Jari Häkkinen)

The scenario:

I have many extracts in different projects. I create a new project that I want to import extracts into. The names I use are partly already in use in other projects (yes reusing names seems strange but hey I want to) so I use the nice 'Item identification' options and set the importer to only look after items in the current project. The batch importer imports the items with new unused names but updates the items with reused names. Refreshing the extract list view will only show the new items not the updated ones since they are not in the current project.

The importer of course fails if I set the mode to create only since it then finds items already in the database.

Change History (3)

comment:1 by Jari Häkkinen, 14 years ago

Description: modified (diff)

comment:2 by Nicklas Nordborg, 14 years ago

I can verify this bug. The relevant part of the code is Line 570-577 in AbstractItemImporter. The code has been there since the first version of batch importers (BASE 2.8), and as far as I can tell it is full of problems.

  1. The default include options for a query are Include.MINE and Include.IN_PROJECT. The options are never cleared even if they have not been set for the job. Eg. the batch importers will always search MINE and IN_PROJECT items.
  2. The "includeSharedTo" setting incorrectly adds Include.MINE option. Eg. the batch importer will never search for SHARED_TO items.
  3. Two of the options test against TRUE and two against FALSE which create unexpected results if the none of the options are selected (even if the other two bugs didn't exist).

The only option that works as expected is the Include.OTHERS option.

There is no easy workaround for this issue. In the scenario above it could work to create a special user account for the import and then change the owner of the created items after the import.

comment:3 by Nicklas Nordborg, 14 years ago

Resolution: fixed
Status: newclosed

(In [5636]) Fixes #1608: batch importer fails on item already exists but it should not

Note: See TracTickets for help on using tickets.