internetarchive / openlibrary

One webpage for every book ever published!
https://openlibrary.org
GNU Affero General Public License v3.0
5.11k stars 1.34k forks source link

Carousels don't follow merged work redirects #5729

Open ghost opened 2 years ago

ghost commented 2 years ago

When QueryCarousels are set by a list of explicit ids, the carousel macro will silently drop a work that has been merged.

Evidence / Screenshot (if possible)

Here's an example collection page with the single carousel showing the problem, which might be helpful for testing.

The carousel on that page should contain four works called explicitly by work id:

OL58400W - Dinotopia: A Land Apart From Time OL14935262W - Dinotopia: World Beneath (before merging) OL19650750W - Dinotopia: Journey to Chandara OL17052360W - Dinotopia: First Flight

At some point, The World Beneath work was merged and now redirects correctly to OL9290760W if you click on the work link. However, the carousel silently drops this work that has been merged. I would expect it to follow the redirect, and use the cover image and link of the new work.

This is the query:

{{QueryCarousel(query="key:(/works/OL58400W OR /works/OL14935262W OR /works/OL17052360W OR /works/OL19650750W)", sort="old", title="Original Illustrated Books by James Gurney", has_fulltext_only=False)}}

This is the carousel:

carousel

Steps to Reproduce

  1. Create a QueryCarousel with a small list of explicit work ids.
  2. Merge one of those work ids into another work.
  3. Refresh the carousel page.

Details

Proposal & Constraints

Related files

Stakeholders

@libjenner

dcapillae commented 2 years ago

The same applies to the reading log: the merged works are displayed without title, author and cover.