-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only display CollectionList if record is a collection #4170
Merged
demiankatz
merged 3 commits into
vufind-org:dev
from
LuomaJuha:add-check-for-collectionlist-tab
Dec 19, 2024
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like isCollection might be the safest bet of all:
Is there any reason not to do it this way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CollectionList can be active on subrecords and seems like not all of them implements is_hierarchy_id which is used in isCollection function check. That is why i was thinking about if using getHierarchyTopID would be better for this occasion 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible this is just a configuration issue? The hierarchy configuration controls which records are considered to be collections and which are not, based on the Solr index. If you have records that act like collections but do not have is_hierarchy_id set, that sounds like something non-standard, and I wonder if it would make more sense to customize record drivers than to introduce non-standard behavior to the record tab.
Bottom line: my feeling is that, at least for the core code, this tab is meant to operate on collections, so the best check we can apply is confirming that the record under consideration is a collection. Anything else feels like introducing different rules here than everywhere else, which doesn't make sense to me. But as I say, it's been a while since I've reviewed all this, so maybe I'm overlooking something -- my feeling, though, is that if something is wrong, the problem runs deeper than just this tab, and maybe needs to be addressed somewhere else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, actually this comment clears up my thoughts. I think the isCollection check makes alot more sense now in this context 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks! I do think adding that check is an improvement, so if it works for you, I'll be happy to approve and merge this once the change is in place.