Problem/Motivation
Noticing in slick_views that the images were always loading the first image. #3085169: All Main stage items contain the path to the first image from the multi-upload field of the content type
Proposed resolution
Load the index requested.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3086989-2-load-renderable-field-index.patch | 658 bytes | joelpittet |
Comments
Comment #2
joelpittetHere's a patch that did the trick for me.
Comment #4
joelpittetNot sure I understand the test failure.
Comment #6
gausarts commentedThank you!
Please allow some time to get back into this.
Please ignore the test. Since Drupal 8.7 the tests randomly failed, other times passed, without any code changes.
Comment #7
joelpittetThanks I wonder if those test failures are due to timing issues since they are JS functional tests. I keep running into issues running those locally though so trickier to debug
Comment #8
gausarts commentedProbably timing. I haven't rechecked any other related methods to delay the execution. Strangely, often time they just passed.
Comment #9
joelpittet@gausarts I don't think my patch is always correct, it's a bit confusing because sometimes the $index is dealing with a $row's index and other times it's a fields index.
It may be better to separate those into two functions?
In a different context with Views rows I changed that line to
return empty($result) ? [] : ($multiple ? $result[$index] : $result);and it fixed it.Comment #10
gausarts commentedYes, that will be fine. Thank you!
Comment #11
joelpittetI have managed to forget where the original issue happened... sorry. I'll postpone this until I find it.
Comment #12
gausarts commentedReducing the tension till you re-open it, hopefully with a repro on this, as we are planning for a full release.
Feel free to change it back the status once re-opened. Thanks!
Comment #13
capmex commentedI experienced the same issue on a multi-value image field displayed using a view (Slick Carousel format) on a product variation, using image thumbnails, the patch fixed it.
Comment #14
gausarts commentedPlease install Slick example, and let me know.
5 of 6 samples are multi-value with thumb navigation similar to your setup, except the Main.
Also be sure to read Slick Views home page and docs for the proven architecture to work with.
In your case (multi-value image):
1. Choose Unformatted list, not Slick carousel, pager 1, check
Use field templateunderStyling,Display all values in the same rowwith 0 underDisplay, etc. In this case choose Slick carousel under Image formatter.2, Choose Slick Carousel if you really have to, pager 3-N, uncheck
Use field templateunderStyling,Display all values in the same rowwith 1 underDisplay, etc. In this case choose Blazy or Image, etc., exept Slick carousel, under Image formatter.3. View more recipes at Slick Views.
Behold for different setup, few of those options are the opposite!
Changing the behavior without considering different setups will immediately break the working samples, if not blank.
Too many to explain, sorry. If you do see problems, consider correct provided recipes, or current limitations if you wish. Yet those recipes are already cooked at Slick example. Please start with it.
Feel free to explore, yet if in trouble, be sure to just clone and use the working recipes.
They are already in docs, anyway.
Regarding patch, if I applied it, it would break existing setups different from yours, so further considerations/ works are still required if re-opened.
That is why I would recommend installing the samples, and putting this on Postponed.
UPDATE:
Updated instructions to explore possibilities specific to your setup as long as you can input the correct logic.
Comment #15
gausarts commentedWhat I meant by "clone" is not simply hitting Clone button, but rather mapping options from the working samples to your setups so you can be exercised in the longer run. If you found, yours is not working like the samples, you are being told/guided by sample to correct it.
Comment #16
gausarts commentedMarking this Fixed since it should work correctly given different setups with the correct, or at least expected, input/logic.
Feel free to re-open if still an issue, or again check out each project docs, hence Slick Views, or comment no. 14 above specific to this issue.
Comment #17
gausarts commentedTagging for easy finding.