Fix isReviewer in manage record menu#9271
Merged
Merged
Conversation
10e798e to
54a909c
Compare
josegar74
reviewed
May 8, 2026
Member
josegar74
left a comment
There was a problem hiding this comment.
I see the following error in the Javascript console:
angular.js?v=54a909cc6308f9989690b07aedc2e7ead0fe849a:15697 TypeError: Cannot read properties of undefined (reading 'groupOwner')
at scope.isReviewer (ToolbarDirective.js:329:78)
at scope.getStatusEffects (ToolbarDirective.js:324:46)
at scope.anyWorkflowOptionDisplayed (ToolbarDirective.js:313:39)
Complaints about scope.md.groupOwner in https://github.com/geonetwork/core-geonetwork/pull/9271/changes#diff-2a3359d9bd35129adf44d18ec994584f8e22dbfaf3e41dcb1b58cb87b47b1547R329
| var isReviewer = | ||
| user.isAdmin() || user.isReviewerForGroup(scope.md.groupOwner); | ||
| return scope.statusEffects[isReviewer ? "reviewer" : "editor"]; | ||
| scope.getStatusEffects = function () { |
Member
There was a problem hiding this comment.
Please check https://github.com/geonetwork/core-geonetwork/pull/9271/changes#diff-2a3359d9bd35129adf44d18ec994584f8e22dbfaf3e41dcb1b58cb87b47b1547L313, it still calls the method with the user parameter.
Contributor
Author
There was a problem hiding this comment.
Fixed in latest push
josegar74
approved these changes
May 9, 2026
10 tasks
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.
Currently, the manage record menu initializes some record-dependent values in the template using
ng-init.This pattern already existed before #9254 which split the record actions menu into separate manage and download menus. However, that split changed the timing of when the manage menu template is created.
Before the split, the relevant menu content was still guarded inside the original template by an
ng-if, song-initusually ran only aftermdhad already been set. After the split, the manage menu is now its own directive and the template can be linked before the directive has finished setting its localmdvalue.As a result, the reviewer state can be initialized incorrectly. When logged in as a reviewer, the workflow step label key is built with the

-editorsuffix instead of-reviewer. Those translation/status keys do not exist for reviewer-only workflow steps, so the workflow actions are not displayed correctly. When logged in as an editor, the actions do not show, which is expected. When logged in as an administrator, the actions still show correctly becauseisRevieweris initialized correctly fromuser.isAdmin().This PR aims to fix the regression introduced by the menu split by removing the record-dependent
ng-initusage and calculating the reviewer state and workflow step label key from the current directive scope instead.Checklist
mainbranch, backports managed with labelREADME.mdfilespom.xmldependency management. Update build documentation with intended library use and library tutorials or documentation