Skip to content

Conversation

@tfmorris
Copy link
Contributor

Closes #11563

Technical

This code should probably be refactored so that it's not copying keys individually, but this fix just keeps the existing pattern.

Testing

copydoc the work from the original bug report
use the same search URL in your local dev instance
make sure Solr editions is NOT checked.

Screenshot

Screenshot 2026-01-13 at 22 50 47

Stakeholders

Copilot AI review requested due to automatic review settings January 14, 2026 03:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes issue #11563 by ensuring that the cover_i field from Solr documents is properly copied to the result object returned by get_doc(). The cover_i field contains the cover ID which is used by templates to display book covers.

Changes:

  • Added cover_i field extraction from Solr documents in the get_doc() function

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

first_edition=doc.get('first_edition', None),
subtitle=doc.get('subtitle', None),
cover_edition_key=doc.get('cover_edition_key', None),
cover_i=doc.get('cover_i', None),
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The existing test for get_doc in openlibrary/plugins/worksearch/tests/test_worksearch.py should be updated to include cover_i in both the input document and expected output to ensure this field is properly tested.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It sounds like the existing test has codified the incorrect behavior. I'll have a look when I get a chance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cover image not displayed in search results

2 participants