Changeset 7742


Ignore:
Timestamp:
Sep 5, 2019, 8:41:10 AM (2 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #2191: Batch item importers fail in create+update mode if an item already exists

The "item exists" check should not fail in "update" mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.15-stable/src/plugins/core/net/sf/basedb/plugins/batchimport/AbstractItemImporter.java

    r7689 r7742  
    628628    this.failIfNotFoundItems = !createMode && "fail".equals(getErrorOption("itemNotFoundError"));
    629629    this.updateExistingItems = updateMode;
    630     this.failIfItemExists = createMode && "fail".equals(getErrorOption("itemExistsError"));
     630    this.failIfItemExists = createMode && !updateMode && "fail".equals(getErrorOption("itemExistsError"));
    631631    this.failIfMultipleFoundItems = "fail".equals(getErrorOption("multipleItemsFoundError"));
    632632    this.failIfNotFoundReference = "fail".equals(getErrorOption("referenceNotFoundError"));
     
    27132713      parameters.add(defaultErrorParameter);
    27142714      if (!createMode) parameters.add(itemNotFoundErrorParameter);
    2715       if (createMode) parameters.add(itemExistsErrorParameter);
     2715      if (createMode && !updateMode) parameters.add(itemExistsErrorParameter);
    27162716      parameters.add(multipleItemsFoundErrorParameter);
    27172717      if (updateMode) parameters.add(noWritePermissionToItemErrorParameter);
Note: See TracChangeset for help on using the changeset viewer.