Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API / Batch edit / Delete with a non matching XPath can remove unwanted elements #6707

Merged
merged 3 commits into from
Dec 12, 2022

Conversation

fxprunayre
Copy link
Member

When using gn_delete tag, always consider it as an XML mode to properly check that we are in deletion mode in EditLib.

Fix wrong test and test various type of config can be self closing tag or not <gn_delete/> or <gn_delete></gn_delete>.

Issue was noticed using the following config

{"field":"Distribution / Remove an online resource by URL","insertMode":"gn_delete","xpath":"/gmd:MD_Metadata/gmd:distributionInfo/*/gmd:transferOptions/*/gmd:onLine[starts-with(*/gmd:linkage/gmd:URL, \"http://www.eea.europa.eu/data-and-maps/data\") or starts-with(*/gmd:linkage/gmd:URL, \"https://cmshare.eea.europa.eu/\")]","value":"","isXpath":true}

which was removing the first gmd:onLine when none were matching because it was not detecting deletion mode.

elements.

When using gn_delete tag, always consider it as an XML mode to properly
check that we are in deletion mode in EditLib.

Fix wrong test and test various type of config can be self closing tag
or not <gn_delete/> or <gn_delete></gn_delete>.

Issue was noticed using the following config

{"field":"Distribution / Remove an online resource by URL","insertMode":"gn_delete","xpath":"/gmd:MD_Metadata/gmd:distributionInfo/*/gmd:transferOptions/*/gmd:onLine[starts-with(*/gmd:linkage/gmd:URL, \"http://www.eea.europa.eu/data-and-maps/data\") or starts-with(*/gmd:linkage/gmd:URL, \"https://cmshare.eea.europa.eu/\")]","value":"","isXpath":true}

which was removing the first gmd:onLine when none were matching.
@fxprunayre fxprunayre added this to the 4.2.2 milestone Dec 7, 2022
…t.java

Co-authored-by: Jose García <josegar74@gmail.com>
@josegar74 josegar74 merged commit 49b1d05 into main Dec 12, 2022
@fxprunayre fxprunayre deleted the 422-batchedit-delete-isalwaysxmlnode branch December 12, 2022 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants