core-geonetwork icon indicating copy to clipboard operation
core-geonetwork copied to clipboard

Metadata categories doesn't work properly with the metadata working copies (workflow enabled)

Open josegar74 opened this issue 1 year ago • 0 comments

Describe the bug When editing an approved metadata with metadata categories, the working copy doesn't get assigned any category.

Editing the metadata working copy and assigning categories in the metadata editor, are not assigned to the working copy version.

To Reproduce Steps to reproduce the behaviour:

  1. Enable the metadata workflow.
  2. Create a new metadata.
  3. In the metadata editor assign the Dataset category and save it.
  4. Approve the metadata and edit it to create a working copy.
  5. Edit the metadata --> in the metadata editor the category Dataset is not selected.
  6. Assign another category, for example Directories and save the metadata --> In the metadata view page the category is not displayed in the working copy.

Expected behavior The metadata working copy gets assigned the same categories as the approved version. Editing the working copy and assigning categories are assigned to the working copy.

When approving again the working copy, the categories from the approved version are replaced by the ones defined in the working copy.


Doing some research, it seems the categories are only available for metadata in the Metadata table

https://github.com/geonetwork/core-geonetwork/blob/2dda63111f24756dcd53b960545080756a64e426/domain/src/main/java/org/fao/geonet/domain/Metadata.java#L64-L79

, but not in the MetadataDraft table.

A simpler solution for now could be to disable the categories dropdown from the metadata editor (at least when editing a working copy) and use the update categories batch action in the editor board.

josegar74 avatar May 03 '23 09:05 josegar74