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
|
/** |
|
* Get the set of metadata categories this metadata is part of. This is lazily |
|
* loaded and all operations are cascaded |
|
* |
|
* @return the metadata categories |
|
*/ |
|
@ManyToMany(cascade = {CascadeType.DETACH, CascadeType.REFRESH}, |
|
fetch = FetchType.EAGER) |
|
@JoinTable(name = METADATA_CATEG_JOIN_TABLE_NAME, |
|
joinColumns = @JoinColumn(name = "metadataId"), |
|
inverseJoinColumns = @JoinColumn(name = |
|
METADATA_CATEG_JOIN_TABLE_CATEGORY_ID)) |
|
@Nonnull |
|
public Set<MetadataCategory> getMetadataCategories() { |
|
return metadataCategories; |
|
} |
, 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.
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:
Datasetcategory and save it.Datasetis not selected.Directoriesand 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
Metadatatablecore-geonetwork/domain/src/main/java/org/fao/geonet/domain/Metadata.java
Lines 64 to 79 in 2dda631
, but not in the
MetadataDrafttable.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.