Closed (fixed)
Project:
Swiper formatter
Version:
2.1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Jul 2025 at 15:56 UTC
Updated:
1 Mar 2026 at 13:50 UTC
Jump to comment: Most recent
Comments
Comment #3
bbu23Comment #4
bbu23Comment #5
sebastixIssue:
The swiper_formatter module is at version 2.0.x-dev and the patch https://git.drupalcode.org/project/swiper_formatter/-/merge_requests/24.... is applied correctly.
Also ran database updates but still, I got these PHP warnings. It seems `swiper_formatter_update_10206` is not getting executed when running database updates.
No default values (swiper options) are set for the key 'keyboard' in $default_array for existing updates or adding a new template.
Comment #6
bbu23Hi @sebastix,
Just tested locally on Drupal 11 and Drupal 10.3. Grabbed the dev version, applied the patch, executed the updates. Everything worked as expected.
It's probably something on your end, unless you can provide more information.
On the other hand and non-related this made me think that we should've probably went for post_update instead. I'll decide on that later.
Comment #7
sebastixThx for the quick reply.
Did you test it on a clean install or existing installation?
I tried to fix the issue / debug why the `swiper_formatter_update_10206` function is not being called when I execute `drush updb` but no luck finding why yet. I'm working on a existing installation where 2.0.1 was installed before I switched to 2.0.x-dev with the patch.
Comment #8
bbu23I have a few dummy projects that I use for testing contributed scenarios. They're not really clean anymore, but not existing if that makes sense.
What I can tell you for sure is that I followed these steps:
1. swiper_formatter was uninstalled or I uninstalled myself
2. downloaded the latest dev version using composer
3. installed the swiper_formatter module
4. applied the patch from the MR
5. navigated to the default swiper formatter entity and observed the warnings (which is as expected)
6. ran drush updb to apply the update (successfully)
7. refreshed the swiper entity page to observe that the warnings are run
If swiper_formatter was already enabled with version 2.0.1 before applying the patch, then I don't explain how the update could've been skipped unless you've already had an update with that same number somehow or if the module was disabled and got enabled after applying the patch, which doesn't seem the case.
Either way, I suggest verifying that the last update schema number is actually 10206 using
drush ev "echo \Drupal::service('update.update_hook_registry')->getInstalledVersion('swiper_formatter');". You could modify it manually to have the update run again, or maybe you can grab a database of your project and redo the test.Comment #9
sebastixdrush ev "echo \Drupal::service('update.update_hook_registry')->getInstalledVersion('swiper_formatter');"returned10206so that seem to be fine.I've set the version back to
10205withdrush ev "\Drupal::service('update.update_hook_registry')->setInstalledVersion('swiper_formatter', 10205);"and randrush updbagain and now the update shows up to be executed.So now with this working, the update is run properly and the existing templates are getting updated which solves the issue with the PHP warnings about missing default values when editing a template.
With that said, the new keyboard feature is working on the frontend when viewing images.
Comment #10
bbu23Perfect, thank you for confirming @sebastix.
Yes, it seems like your update was marked as executed for some reason.
Comment #11
bbu23We might need to update the default config to contain the keyboard addition.
Comment #12
bbu23Comment #16
bbu23Thanks guys, this will be available in 2.1.0