-
Notifications
You must be signed in to change notification settings - Fork 651
AO3-6067 Uncategorized fandoms in collections not showing #5514
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
base: master
Are you sure you want to change the base?
Conversation
The new fandom method actually would return any fandom, even possible copy of fandom already in fandom_ids
|
I'd like to add a test to make sure that non-canonical fandoms don't get double counted. How exactly do I set up a non-canonical fandom under a canonical fandom in cucumber? After this is done, I shall remove put this as ready for review |
| query.search_results.each do |work| | ||
| list |= work.fandom_ids if work.fandom_ids.present? | ||
| work.tag_groups["Fandom"].each do |fandom| | ||
| list.push(fandom.id) if Fandom.find_by(id: fandom.id).unwrangled? |
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.
| list.push(fandom.id) if Fandom.find_by(id: fandom.id).unwrangled? | |
| list.push(fandom.id) if fandom.unwrangled? |
Will this work?
| def index | ||
| if @collection | ||
| @media = Media.canonical.by_name - [Media.find_by(name: ArchiveConfig.MEDIA_NO_TAG_NAME)] - [Media.find_by(name: ArchiveConfig.MEDIA_UNCATEGORIZED_NAME)] | ||
| @media = Media.canonical.by_name.where.not(name: [ArchiveConfig.MEDIA_UNCATEGORIZED_NAME, ArchiveConfig.MEDIA_NO_TAG_NAME]) + [Media.uncategorized] |
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.
| @media = Media.canonical.by_name.where.not(name: [ArchiveConfig.MEDIA_UNCATEGORIZED_NAME, ArchiveConfig.MEDIA_NO_TAG_NAME]) + [Media.uncategorized] | |
| @media = Media.canonical.by_name.where.not(name: [ArchiveConfig.MEDIA_NO_TAG_NAME]) |
This should be enough too, what do you think?
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.
I think removing it then adding it back is necessary for the uncategorized fandoms to show last
Issue
https://otwarchive.atlassian.net/browse/AO3-6067
Purpose
This makes uncategorized fandoms be listed on collection fandoms page. As a bonus, this also makes the unwrangled tags collection page show only the work in the collection. This modifies the method used to fetch the fandom (being a combination of how it used to work with the fandom_ids field, and how view works, by going through the fandom tags on the work).
Credit
Danaël / Rever ( they / he )
Danaël Villeneuve on jira