Skip to content

Fix md is null in record view#8768

Merged
ianwallen merged 4 commits into
geonetwork:mainfrom
tylerjmchugh:main.fix-md-is-null-in-recordView
May 6, 2025
Merged

Fix md is null in record view#8768
ianwallen merged 4 commits into
geonetwork:mainfrom
tylerjmchugh:main.fix-md-is-null-in-recordView

Conversation

@tylerjmchugh
Copy link
Copy Markdown
Contributor

@tylerjmchugh tylerjmchugh commented Apr 30, 2025

Following #7802 the md object is not set in the recordView template. The reason is that gnMdActionsMenu set the md object and now it is in a different scope.

This causes several issues:

The working copy link is broken (UUID is missing):
image

The record links are not shown:
image

The status label is not shown:
image

This PR aims to fix this issue by changing the template and sub templates to use mdView.current.record instead of md. With the changes from this PR all three of these issues are fixed.

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 added this to the 4.4.8 milestone May 1, 2025
@ianwallen ianwallen requested a review from josegar74 May 2, 2025 11:29
Copy link
Copy Markdown
Member

@josegar74 josegar74 left a comment

Choose a reason for hiding this comment

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

Tested, works fine.

@ianwallen ianwallen merged commit bd4d148 into geonetwork:main May 6, 2025
9 checks passed
@geonetworkbuild
Copy link
Copy Markdown
Collaborator

The backport to 4.2.x failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply b4733406e8... Change md to mdView.current.record
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"

stdout
Auto-merging web-ui/src/main/resources/catalog/views/default/templates/recordView/downloads.html
CONFLICT (content): Merge conflict in web-ui/src/main/resources/catalog/views/default/templates/recordView/downloads.html
Auto-merging web-ui/src/main/resources/catalog/views/default/templates/recordView/recordView.html

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.2.x 4.2.x
# Navigate to the new working tree
cd .worktrees/backport-4.2.x
# Create a new branch
git switch --create backport-8768-to-4.2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick b4733406e8f39ab9329ed06db5b0339a22d6e512,42646a33b42f41de312429fee3869f2d7c4d54f7,e7a505353a0c2fdc88fb9ea7f749bb9d1e10bc97,8b6c0ec7ccc49cfc64c1103c289e8ffafe4c93c0
# Push it to GitHub
git push --set-upstream origin backport-8768-to-4.2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.2.x

Then, create a pull request where the base branch is 4.2.x and the compare/head branch is backport-8768-to-4.2.x.

tylerjmchugh added a commit to tylerjmchugh/core-geonetwork that referenced this pull request May 6, 2025
* Change md to mdView.current.record

* Add isMdWorkflowEnable to GnMdViewController

* Refactor recordviewMenu

* Whitespace/layout

(cherry picked from commit bd4d148)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants