Skip to content

[Fixes #14455] XML metadata is not regenerated after updating metadata - #14456

Merged
etj merged 2 commits into
masterfrom
14455_xml_metadata
Jul 23, 2026
Merged

[Fixes #14455] XML metadata is not regenerated after updating metadata#14456
etj merged 2 commits into
masterfrom
14455_xml_metadata

Conversation

@etj

@etj etj commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #14455

  • Refact catalogue_post_save to extract update_csw_metadata procedure
  • Call update_csw_metadata after saving metadata.

Preferred this explicit implementation instead of calling get_real_instance for triggering catalogue_post_save by signal

Checklist

Reviewing is a process done by project maintainers, mostly on a volunteer basis. We try to keep the overhead as small as possible and appreciate if you help us to do so by completing the following items. Feel free to ask in a comment if you have troubles with any of them.

For all pull requests:

  • Confirm you have read the contribution guidelines
  • You have sent a Contribution Licence Agreement (CLA) as necessary (not required for small changes, e.g., fixing typos in the documentation)
  • Make sure the first PR targets the master branch, eventual backports will be managed later. This can be ignored if the PR is fixing an issue that only happens in a specific branch, but not in newer ones.

The following are required only for core and extension modules (they are welcomed, but not required, for contrib modules):

  • There is a ticket in https://github.com/GeoNode/geonode/issues describing the issue/improvement/feature (a notable exemption is, changes not visible to end-users)
  • The issue connected to the PR must have Labels and Milestone assigned
  • PR for bug fixes and small new features are presented as a single commit
  • PR title must be in the form "[Fixes #<issue_number>] Title of the PR"
  • New unit tests have been added covering the changes, unless there is an explanation on why the tests are not necessary/implemented

Submitting the PR does not require you to check all items, but by the time it gets merged, they should be either satisfied or inapplicable.

@etj
etj requested a review from mattiagiupponi July 22, 2026 11:23
@etj etj self-assigned this Jul 22, 2026
Copilot AI review requested due to automatic review settings July 22, 2026 11:23
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@cla-bot cla-bot Bot added the cla-signed CLA Bot: community license agreement signed label Jul 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses GeoNode issue #14455 by ensuring CSW XML metadata is regenerated after users update resource metadata via the API. It refactors catalogue post-save behavior to centralize the XML/ANYTEXT regeneration logic and explicitly triggers that regeneration after metadata updates.

Changes:

  • Extracted CSW XML/ANYTEXT regeneration into a reusable update_csw_metadata() helper.
  • Updated catalogue_post_save() to use the extracted helper during normal catalogue synchronization.
  • Invoked update_csw_metadata() after metadata updates in the PUT/PATCH /api/v2/metadata/instance/<pk>/ flow.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
geonode/metadata/api/views.py Calls CSW metadata regeneration after saving updated JSON-schema metadata.
geonode/catalogue/models.py Refactors catalogue post-save to reuse update_csw_metadata() and adjusts link recreation / logging paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread geonode/catalogue/models.py Outdated
Comment thread geonode/catalogue/models.py Outdated
Comment thread geonode/catalogue/models.py Outdated
Comment thread geonode/metadata/api/views.py
@etj
etj force-pushed the 14455_xml_metadata branch from 4e4095d to 03c3415 Compare July 22, 2026 14:02
@etj
etj merged commit ad4d7bf into master Jul 23, 2026
15 checks passed
@etj
etj deleted the 14455_xml_metadata branch July 23, 2026 08:11
etj added a commit that referenced this pull request Jul 23, 2026
#14456) (#14462)

(cherry picked from commit ad4d7bf)

Co-authored-by: Emanuele Tajariol <e.tajariol@gmail.com>
etj added a commit that referenced this pull request Jul 23, 2026
#14456) (#14461)

(cherry picked from commit ad4d7bf)

Co-authored-by: Emanuele Tajariol <e.tajariol@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 5.0.x backport 5.1.x bug cla-signed CLA Bot: community license agreement signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

XML metadata is not regenerated after updating metadata

3 participants