Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
Issue #492
  • Loading branch information
rsoika committed Apr 4, 2022
1 parent 4845c30 commit c0ab0e3
Showing 1 changed file with 21 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,27 @@ public ItemCollection loadConfiguration(String name, boolean discardCache) {
* @return
* @throws AccessDeniedException
*/
public ItemCollection save(ItemCollection configItemCollection) throws AccessDeniedException {
// update write and read access
configItemCollection.replaceItemValue("type", TYPE);

// save entity
configItemCollection = documentService.save(configItemCollection);

cache.put(configItemCollection.getItemValueString("txtName"), configItemCollection);

return configItemCollection;
}
public ItemCollection save(ItemCollection configItemCollection) throws AccessDeniedException {
// save $version
int version=configItemCollection.getItemValueInteger(DocumentService.VERSION);

// update write and read access
configItemCollection.replaceItemValue("type", TYPE);

// save entity
configItemCollection = documentService.save(configItemCollection);

// here we verify if the $version was removed from the documentService.save method!
// issue #380
if (!configItemCollection.hasItem(DocumentService.VERSION)) {
// force update $version
version ++;
configItemCollection.setItemValue(DocumentService.VERSION,version);
}

cache.put(configItemCollection.getItemValueString("txtName"), configItemCollection);
return configItemCollection;
}

/**
* Returns a list of all configuration entities. The method uses JQPL staements instead of lucene index.
Expand Down

0 comments on commit c0ab0e3

Please sign in to comment.