Summary: | Fix links for local cover images for items on staff detail page | ||
---|---|---|---|
Product: | Koha | Reporter: | David Cook <dcook> |
Component: | Staff interface | Assignee: | David Cook <dcook> |
Status: | Pushed to stable --- | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | david, fridolin.somers, gmcharlt, jonathan.druart, lucas |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
This fixes the local cover image links for items (staff interface record details holdings table > dropdown link for Edit > Upload image) by removing unnecessary parameters, fixing an invalid link, an uninitialised Template::Toolkit variable. This has no noticeable effect, but is important for avoiding future issues.
|
Version(s) released in: |
24.11.00,24.05.02
|
Circulation function: | |||
Bug Depends on: | 28179 | ||
Bug Blocks: | |||
Attachments: |
Bug 36966: Fix local cover image links for items
Bug 36966: Fix local cover image links for items Bug 36966: Fix data-link for local cover images Bug 36966: Fix local cover image links for items Bug 36966: Fix data-link for local cover images Bug 36966: Actually fix data-link for local cover images Bug 36966: Fix local cover image links for items Bug 36966: Fix data-link for local cover images Bug 36966: Actually fix data-link for local cover images Bug 36966: Fix local cover image links for items Bug 36966: Fix data-link for local cover images Bug 36966: Actually fix data-link for local cover images |
Description
David Cook
2024-05-27 03:10:43 UTC
(Btw as I fix this... I think I notice we're still using & to separate query parameters in URLs when we should be using &. It's a reserved character for that purpose.) Created attachment 167187 [details] [review] Bug 36966: Fix local cover image links for items This change fixes the local cover image links for items by removing unnecessary parameters, an invalid link, and an uninitialised Template::Toolkit variable. Test plan: 0. Apply patch 1. Enable syspref 'LocalCoverImages' 3. Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29 4. Click on the dropdown next to "Edit" at the item level 5. Upload an image for the item 6. Note that the local cover image appears in the holdings table 7. Click on the image and note that it loads in the light box 8. Success! Should this data-link attr removed from other places? Created attachment 167195 [details] [review] Bug 36966: Fix local cover image links for items This change fixes the local cover image links for items by removing unnecessary parameters, an invalid link, and an uninitialised Template::Toolkit variable. Test plan: 0. Apply patch 1. Enable syspref 'LocalCoverImages' 3. Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29 4. Click on the dropdown next to "Edit" at the item level 5. Upload an image for the item 6. Note that the local cover image appears in the holdings table 7. Click on the image and note that it loads in the light box 8. Success! Signed-off-by: David Nind <david@davidnind.com> (In reply to Jonathan Druart from comment #3) > Should this data-link attr removed from other places? Actually, I think I shouldn't have removed it here. I couldn't see anywhere it was used, but looking again today I can see that at the very bottom of light box page it should say "Local cover image (edit)" and that has a link to the editor. I do have a way of making that work. I'll take a look... Yeah nah I definitely broke it in a different way.. Created attachment 167236 [details] [review] Bug 36966: Fix data-link for local cover images This patch fixes the data-link so that the "edit" link at the bottom of the lightbox viewer correctly takes the user to the editor interface for the local cover image Created attachment 167254 [details] [review] Bug 36966: Fix local cover image links for items This change fixes the local cover image links for items by removing unnecessary parameters, an invalid link, and an uninitialised Template::Toolkit variable. Test plan: 0. Apply patch 1. Enable syspref 'LocalCoverImages' 3. Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29 4. Click on the dropdown next to "Edit" at the item level 5. Upload an image for the item 6. Note that the local cover image appears in the holdings table 7. Click on the image and note that it loads in the light box 8. Success! Signed-off-by: David Nind <david@davidnind.com> Created attachment 167255 [details] [review] Bug 36966: Fix data-link for local cover images This patch fixes the data-link so that the "edit" link at the bottom of the lightbox viewer correctly takes the user to the editor interface for the local cover image Signed-off-by: David Nind <david@davidnind.com> I think this works... but it seems the only way to replace the item-level image is via Edit > Upload image. Before patch applied: 0. Enable LocalCoverImages system preference 1. Upload a record-level image: 1.1 Upload a record-level image: Images tab > Upload 1.2 Upload an item-level image: Holding stab > Edit > Upload image > [use a different image from the record-level one) ==> Result: Different record-level and item-level images 2. Replace the item-level image (Edit > Upload image): 2.1 Replace the item-level cover image: Holdings tab > Edit > Upload image > [use a different image from the record-level image] ==> Result: item-level image replaced (as expected) 3. Replace the item-level image (click on cover image in holdings table): 3.1 Attempt to replace the item-level image: click on the item-level cover under the cover image column > click edit in the light-box viewer > get error trace: Can't call method "biblionumber" on an undefined value at /kohadevbox/koha/catalogue/imageviewer.pl line 42 After the patches are applied: 1. Repeat 3.1: displays all existing images (record and item-level images), and can "Drop files here or click to select a file". Drag and drop a replacement image: ==> Result: . Record-level image replaced . For search results, item-level image displayed Hope I haven't confused things! (In reply to David Nind from comment #10) > Hope I haven't confused things! Nah, I think it's a good catch. I think I've just confused myself a bit previously. Too much multitasking... Created attachment 167259 [details] [review] Bug 36966: Actually fix data-link for local cover images Ok... "now" it should work haha. (In reply to David Cook from comment #13) > Ok... "now" it should work haha. Thanks David. Sign off on the way. Thinks I learnt with this big, you can have item-level cover images. David Created attachment 167263 [details] [review] Bug 36966: Fix local cover image links for items This change fixes the local cover image links for items by removing unnecessary parameters, an invalid link, and an uninitialised Template::Toolkit variable. Test plan: 0. Apply patch 1. Enable syspref 'LocalCoverImages' 3. Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29 4. Click on the dropdown next to "Edit" at the item level 5. Upload an image for the item 6. Note that the local cover image appears in the holdings table 7. Click on the image and note that it loads in the light box 8. Success! Signed-off-by: David Nind <david@davidnind.com> Created attachment 167264 [details] [review] Bug 36966: Fix data-link for local cover images This patch fixes the data-link so that the "edit" link at the bottom of the lightbox viewer correctly takes the user to the editor interface for the local cover image Signed-off-by: David Nind <david@davidnind.com> Created attachment 167265 [details] [review] Bug 36966: Actually fix data-link for local cover images Signed-off-by: David Nind <david@davidnind.com> Created attachment 168090 [details] [review] Bug 36966: Fix local cover image links for items This change fixes the local cover image links for items by removing unnecessary parameters, an invalid link, and an uninitialised Template::Toolkit variable. Test plan: 0. Apply patch 1. Enable syspref 'LocalCoverImages' 3. Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29 4. Click on the dropdown next to "Edit" at the item level 5. Upload an image for the item 6. Note that the local cover image appears in the holdings table 7. Click on the image and note that it loads in the light box 8. Success! Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 168091 [details] [review] Bug 36966: Fix data-link for local cover images This patch fixes the data-link so that the "edit" link at the bottom of the lightbox viewer correctly takes the user to the editor interface for the local cover image Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 168092 [details] [review] Bug 36966: Actually fix data-link for local cover images Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Pushed for 24.11! Well done everyone, thank you! Backported to 24.05.x for upcoming 24.05.02 Does not apply on 23.11.x Looks like this depends on Bug 33568 right ? |