Prevent removal of already removed menu sections from throwing errors - #4539
Merged
tdonohue merged 2 commits intoMar 2, 2026
Conversation
…eady removed filter
|
Hi @alexandrevryghem, |
alexandrevryghem
force-pushed
the
handle-non-existing-menu-section-removal-error_contribute-main
branch
from
November 30, 2025 22:44
4bb11c0 to
cfb4fea
Compare
|
QA testing performed (no code review). Working as expected:
No visible regressions in existing menu providers. |
tdonohue
approved these changes
Mar 2, 2026
tdonohue
left a comment
Member
There was a problem hiding this comment.
👍 Thanks @alexandrevryghem ! The code looks good to me, along with the new specs. As this has been tested by @alegontarz (thanks as well!) this looks good to me.
Contributor
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin dspace-7_x
git worktree add -d .worktree/backport-4539-to-dspace-7_x origin/dspace-7_x
cd .worktree/backport-4539-to-dspace-7_x
git switch --create backport-4539-to-dspace-7_x
git cherry-pick -x 2f051276ce6c7a6d466001cb2a6a01cbd7ec8b4b |
Contributor
|
Successfully created backport PR for |
Contributor
|
Successfully created backport PR for |
alexandrevryghem
deleted the
handle-non-existing-menu-section-removal-error_contribute-main
branch
March 2, 2026 23:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixed an issue where the menu reducer could throw an error when you tried to delete an already deleted menu section. This can occur when you remove all the menu sections individually, and the parent section gets deleted before all its child sections are removed. This is because the deletion of a parent menu also removes all it's child sections (see
menu.reducer.ts#removeFromIndex), and when you try to remove an already deleted menu section, an error will be thrown.Instructions for Reviewers
List of changes in this PR:
hasNoValuecheck to prevent themenu.reducer.ts#removeFromIndexfrom throwing an error when a section doesn't exist anymoreGuidance for how to review this PR.
This error is not directly reproducible in default DSpace but it's a nice safeguard. To review, simply verify that the regular menu providers are not affected by this new condition, and that the new test succeeds
Checklist
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.