pkp / oaiJats

OAI support for the JATS metadata format
GNU General Public License v3.0
5 stars 11 forks source link

Keyword groups in multilingual journals duplicated #30

Closed ewhanson closed 2 years ago

ewhanson commented 2 years ago

Any keyword groups that have been added previously are supposed to be removed in _mungeMetadata() in the line below, but only the first node is ever removed. If an article has more than one set of kwd-group tags for multilingual keywords, the remaining sets will remain and be duplicated once OJS adds back in its own set of keywords.

https://github.com/pkp/oaiJats/blob/d611794518dc74cab863473ac252e4f516a3d6d1/OAIMetadataFormat_JATS.inc.php#L286

Example:

Screen Shot 2022-05-10 at 13 00 25

ewhanson commented 2 years ago

Hey @asmecher, could you have a look at this? I've made a PR against stable-3_3_0, but if this approach looks okay, I can make a PR against main as well. Thanks!

PR:

asmecher commented 2 years ago

This weird getElementsByTagName / removeChild behavior doesn't appear to be documented anywhere I can see it, but it's alluded to here: https://www.php.net/manual/en/domnode.removechild.php#90292

Please go ahead with a port to main, thanks!

ewhanson commented 2 years ago

Thanks @asmecher! I've created a PR against main.

PR:

asmecher commented 2 years ago

Merged, thanks!