[Koha-bugs] [Bug 34149] Syndetics cover images don't load in staff interface detail page if other images services are enabled

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Sep 18 02:30:03 CEST 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34149

Victor Grousset/tuxayo <victor at tuxayo.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |victor at tuxayo.net
             Status|Signed Off                  |Failed QA

--- Comment #9 from Victor Grousset/tuxayo <victor at tuxayo.net> ---
Exact same code on OPAC so same bug and attached follow-up to also fix OPAC.
Follow-up needs someone else to test it.

But before that, looking at the code, the same issue is very very likely to be
there with anything else, right?
custom-coverimg, googlejacket-coverimg, openlibrary-coverimg, coce-coverimg,
bakertaylor-coverimg, "cover-image local-coverimg".

And custom-coverimg also has a path to "div.remove();" so it should trigger the
same issue than amazon-bookcoverimg.

Oh no >_<

Either the same fix is applied to all of them.
`if ( $('#amazon-bookcoverimg').length === 0 )` need to be changed to account
for custom-coverimg case. Maybe it's tricky because custom-coverimg isn't the
1st one when amazon is enabled. Also maybe careful when both are in their
invalid cases. Nooooot sure, I'm way too confused now 😵‍💫😵‍💫😵‍💫

Either there is a more clever way than putting div.show() on all cases and
instead just prevent amazon-bookcoverimg handling to mess with the others.

Inspecting the page: why is the problem even happening? The div removed is only
the one for amazon-bookcoverimg. Why does that messes the others?

Ah ok, it's because the 1st one is shown and if at the end of the processing
none is visible then the whole enclosing div is removed.

That's the root of the whole mess.

Idea: After the div.remove(); in the 1x1 pixel case, make the next element in
$(img) visible.
Wait, custom-coverimg needs to same (right?) but it needs to check if
themselves are visible. Otherwise if amazon has a valid image it would cause
the 3rd image to be visible at the same time. And check it before doing
div.remove()! Ok it's still wacky 😵‍💫

Alternative idea: set the 1st one visible by default **after the processing**
of all of them, so we don't care about all the mess they do.
After `// Loop over each container in the template which contains covers`

separation_of_concerns++
The issue is mixing getting data and filtering out the invalid ones and mixing
display logic (1st img tab visible on page load)

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list