Closed (fixed)
Project:
Swiper formatter
Version:
2.0.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Oct 2024 at 21:56 UTC
Updated:
14 Jan 2026 at 21:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
kul.pratap commentedComment #4
kul.pratap commentedI have generated MR, Kindly check it.

No Warning after that.
Comment #5
kul.pratap commentedPlease check it (:
Comment #6
nk_ commentedThanks. I thought it was safer to do make this logic in PHP, so I placed a few lines of code in the module to not even initialize swiper but do inform (status warning) user about it.
Note that this is only in 1.0.x-dev version for now. For 2.0.x will come soonest
Comment #7
nk_ commentedComment #9
nk_ commentedPushed into 2.0.x-dev and is ready for testing.
Comment #10
tirupati_singh commentedHi @nk, I've tested the mentioned issue on 2.0.x-dev and when the number of slide is less than 2 getting a warning message as shown in the attached screenshot when saving/updating the node. And confirm that the changes are working fine, did not get any console errors when the slider has only one slide. I'm attaching the screenshot for your reference. As the changes are working fine moving the issue to RTBC.
Thanks!
Comment #11
bbu23Thanks.
Comment #13
bbu23Comment #14
dalinOooph.
This patch causes many problems:
* PHP warning because of sometimes `count()` on NULL.
* Despite the permissions check, this patch doesn't set cache contexts, so the warning message will be cached and shown to anonymous visitors.
* I'm unsure why a content editor needs to be told that a widget is choosing option B instead of option A. This is just confusion inducing.
* IMO the JS console message is a _good_ thing to help debug what's going on. IMO there's no need to remove it in the first place, though I understand why others might disagree.
I'll roll a new issue to fix the first three.