Bug 12559 - Wrong message if all cover images deleted
Summary: Wrong message if all cover images deleted
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-11 18:33 UTC by Tomás Cohen Arazi
Modified: 2015-06-04 23:33 UTC (History)
1 user (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 12559: Wrong message if all cover images deleted (4.14 KB, patch)
2014-07-11 18:45 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 12559: Wrong message if all cover images deleted (4.19 KB, patch)
2014-07-15 01:08 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
[PASSED QA] Bug 12559: Wrong message if all cover images deleted (4.26 KB, patch)
2014-07-18 12:56 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2014-07-11 18:33:42 UTC
If a record contains a (one or more) local cover image and it is deleted, a wrong message is presented in the UI.

To reproduce:
 - Have LocalCoverImages set to "Display" and AllowMultipleCovers set to "Allow".
 - Go to the detail page of a record that has no images attached.
 - The 'Images' tab conveniently shows the following message:
   "No images have been uploaded..."
 - Use the "upload" link to add a local cover to the record
 - Complete the process, and "view final record".
 - The 'Images' tab shows the added cover.
 - Delete the cover image using the link below the cover.
=> FAIL: 'Click on an image...' message still shows instead of 'No images have been...'

You can try when more than one cover image, same results.
Comment 1 Tomás Cohen Arazi 2014-07-11 18:45:00 UTC Comment hidden (obsolete)
Comment 2 Biblibre Sandboxes 2014-07-15 01:07:44 UTC
Patch tested with a sandbox, by Aleisha <aleishaamohia@hotmail.com>
Comment 3 Biblibre Sandboxes 2014-07-15 01:08:08 UTC Comment hidden (obsolete)
Comment 4 Kyle M Hall 2014-07-18 12:56:35 UTC
Created attachment 29829 [details] [review]
[PASSED QA] Bug 12559: Wrong message if all cover images deleted

If a record contains a (one or more) local cover image and it is deleted, a wrong message is presented in the UI.

To reproduce:
 - Have LocalCoverImages set to "Display" and AllowMultipleCovers set to "Allow".
 - Go to the detail page of a record that has no images attached.
 - The 'Images' tab conveniently shows the following message:
   "No images have been uploaded..."
 - Use the "upload" link to add a local cover to the record
 - Complete the process, and "view final record".
 - The 'Images' tab shows the added cover.
 - Delete the cover image using the link below the cover.
=> FAIL: 'Click on an image...' message still shows instead of 'No images have been...'

To test:
 - Apply the patch
 - Repeat the previous steps
=> SUCCESS : 'No images have been...'

Bonus points: previous code didn't show a message at all if the user didn't have
permissions to upload local cover images. I've split the message  in two:
 - 'No images have been...' (for everyone)
 - 'Please upload (link)...' (for those with the right permissions :-D

Regards
To+

Edit: I used JavaScript to inject the 'No images...' message to aid localization.
It can be improved once we fix some stuff in the translation scripts to better support
placeholders/variables in the templates.

Sponsored-by: Universidad Nacional de Cordoba

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Tomás Cohen Arazi 2014-07-18 15:53:11 UTC
Patch pushed to master.