Skip to content

Fix remove user selection is using the wrong api#9280

Merged
PascalLike merged 1 commit into
geonetwork:mainfrom
tylerjmchugh:fix-remove-user-selection
May 18, 2026
Merged

Fix remove user selection is using the wrong api#9280
PascalLike merged 1 commit into
geonetwork:mainfrom
tylerjmchugh:fix-remove-user-selection

Conversation

@tylerjmchugh
Copy link
Copy Markdown
Contributor

@tylerjmchugh tylerjmchugh commented May 15, 2026

Following #9273 there are still issues with the user selection caused by #8864

When we try to remove a user selection from the UI, the deleteUserSelection endpoint is called instead of deleteUserSelectionRecords.

This endpoint is restricted to UserAdmin, so nothing happens when non-admin users try to remove a selection.

When a UserAdmin or higher removes a selection, the endpoint is called successfully. However, this endpoint removes all records for all users for that selection type, and then removes the selection type from the database.

For example, if an admin adds two records to their watchlist and then removes one, the entire watchlist selection is removed for all users. The watchlist type itself no longer exists, so the next time anyone tries to add something to their watchlist, the option is no longer available.
image

This PR aims to fix this issue by calling deleteUserSelectionRecords when removing a selection from the UI, so only the selected record is removed from the current user's selection.

Checklist

  • I have read the contribution guidelines
  • Pull request provided for main branch, backports managed with label
  • Good housekeeping of code, cleaning up comments, tests, and documentation
  • Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
  • Clean commit messages, longer verbose messages are encouraged
  • API Changes are identified in commit messages
  • Testing provided for features or enhancements using automatic tests
  • User documentation provided for new features or enhancements in manual
  • Build documentation provided for development instructions in README.md files
  • Library management using pom.xml dependency management. Update build documentation with intended library use and library tutorials or documentation

@ianwallen ianwallen self-requested a review May 16, 2026 10:33
@ianwallen ianwallen added this to the 4.4.11 milestone May 16, 2026
@ianwallen ianwallen added the bug label May 16, 2026
@PascalLike PascalLike merged commit 1e0ea16 into geonetwork:main May 18, 2026
8 checks passed
fxprunayre pushed a commit to SPW-DIG/metawal-core-geonetwork that referenced this pull request May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants