Noticed while testing bug 28179 that sometimes the 'spinning icon' for local covers won't go away on the small display on the left of the detail page in the staff interface. It looks like this is related to the size of the picture. I was using cropped screenshots, so nothing too high quality. Joubu wrote: >If the image is small you will see the loading image in the background. >It's worth to open a new bug report.
The spinner is always visible with images which are under 80-90 px high To test: 1. Make sure the LocalCoverImages system preference is enabled 1.1. Go to Administration > Global system preferences 1.2. Search for Coverimages 1.3. Set LocalCoverImages to 'Show' 1.4. Click 'Save all Enhanced content preferences' 2. Add a short local cover image to a record (I added one which is just a grey rectangle with the size printed on it, to facilitate the test) 2.1. Download the attached image 2.2. Find a record without an image 2.3. Click the 'Images' tab 2.4. Click 'Upload' 2.5. Click 'Drop files here or click to select a file' and choose the downloaded image 2.6. Click 'Process images' 2.7. Click on the title of the record in the page heading to access the detailed record --> Note that the image is displayed normally, but the spinner is also displayed In the staff interface, the problem is only on the detailed record page. The search results are OK.
Created attachment 145333 [details] 140 x 50 px image for tests
Created attachment 145481 [details] [review] Bug 28314: Spinning icon is not always going away for local covers in staff The spinner is always visible with images which are under 80-90 px high this patch remove the spinner when the image is loaded. To test: 1. Make sure the LocalCoverImages system preference is enabled 1.1. Go to Administration > Global system preferences 1.2. Search for Coverimages 1.3. Set LocalCoverImages to 'Show' 1.4. Click 'Save all Enhanced content preferences' 2. Add a short local cover image to a record (I added one which is just a grey rectangle with the size printed on it, to facilitate the test) 2.1. Download the attached image 2.2. Find a record without an image 2.3. Click the 'Images' tab 2.4. Click 'Upload' 2.5. Click 'Drop files here or click to select a file' and choose the downloaded image 2.6. Click 'Process images' 2.7. Click on the title of the record in the page heading to access the detailed record --> Note that the image is displayed normally, but the spinner is also displayed 4. Apply the patch 5. Search for the previous record with the small image 6. Click on the title of the record in the page heading to access the detailed record --> Note that the spinner is no more displayed
Created attachment 145748 [details] Bug 32366: (bug 30460 follow-up) Add tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Comment on attachment 145748 [details] Bug 32366: (bug 30460 follow-up) Add tests This attachment was added in error by the sandbox.
I tested this successfully on my Koha Testing Docker, but got an error when trying to sign off. I then tried to add a signoff via the sandbox and it attached a patch from another bug. Here's the error I got in KTD: root@kohadevbox:koha(master)$ git bz attach -e 28314 HEAD /usr/bin/git-bz:1908: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal obsoleted = (initial_description == patch.description) Traceback (most recent call last): File "/usr/bin/git-bz", line 2722, in <module> do_attach(*args) File "/usr/bin/git-bz", line 2074, in do_attach attach_commits(bug, commits, edit_comments=global_options.edit) File "/usr/bin/git-bz", line 1988, in attach_commits description, body, obsoletes, statuses, patch_complexities, depends = edit_attachment_comment(bug, commit.subject, body) File "/usr/bin/git-bz", line 1940, in edit_attachment_comment lines = edit_template(template.getvalue()) File "/usr/lib/python2.7/StringIO.py", line 271, in getvalue self.buf += ''.join(self.buflist) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 3: ordinal not in range(128) I've gotten this error on other patches, too. I don't believe it's anything to go with this code in particular. This patch works as described.
Created attachment 145938 [details] [review] Bug 28314: Spinning icon is not always going away for local covers in staff The spinner is always visible with images which are under 80-90 px high this patch remove the spinner when the image is loaded. To test: 1. Make sure the LocalCoverImages system preference is enabled 1.1. Go to Administration > Global system preferences 1.2. Search for Coverimages 1.3. Set LocalCoverImages to 'Show' 1.4. Click 'Save all Enhanced content preferences' 2. Add a short local cover image to a record (I added one which is just a grey rectangle with the size printed on it, to facilitate the test) 2.1. Download the attached image 2.2. Find a record without an image 2.3. Click the 'Images' tab 2.4. Click 'Upload' 2.5. Click 'Drop files here or click to select a file' and choose the downloaded image 2.6. Click 'Process images' 2.7. Click on the title of the record in the page heading to access the detailed record --> Note that the image is displayed normally, but the spinner is also displayed 4. Apply the patch 5. Search for the previous record with the small image 6. Click on the title of the record in the page heading to access the detailed record --> Note that the spinner is no more displayed Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Nice little fix, no regressions. QA scripts happy, Passed!
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work, thanks everyone! Pushed to 22.11.x for the next release.
Backported to 22.05.x for upcoing 22.05.10
applied to 21.11.x for 21.11.16
Not backported to 21.05.x
This code may get further attention. See change on 32642 for OPAC. The line $(coverSlide).addClass("cover-slides"); is actually hilarious, since we start showing the spinner after all images have been loaded. And then rightaway try to remove it.