core-geonetwork
core-geonetwork copied to clipboard
Metadata categories doesn't work properly with the metadata working copies (workflow enabled)
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:
- Enable the metadata workflow.
- Create a new metadata.
- In the metadata editor assign the
Dataset
category and save it. - Approve the metadata and edit it to create a working copy.
- Edit the metadata --> in the metadata editor the category
Dataset
is not selected. - 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.