Hi, I noticed that the deprecated library "jQuery.once" is still being used in the module and causing the functionalities to break in Drupal 10.
TypeError: $panelizer_checkbox.once is not a function
at Object.attach (http://127.0.0.1:8080/modules/contrib/panelizer/js/panelizer-default-for...)
at http://127.0.0.1:8080/core/misc/drupal.js?v=10.0.7:166:24
at Array.forEach ()
at Drupal.attachBehaviors (http://127.0.0.1:8080/core/misc/drupal.js?v=10.0.7:162:34)
at http://127.0.0.1:8080/core/misc/drupal.init.js?v=10.0.7:32:12
at HTMLDocument.listener (http://127.0.0.1:8080/core/misc/drupal.init.js?v=10.0.7:20:7)
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3352704-3-drupal-10-compatibility-follow-up.patch | 16.68 KB | sker101 |
Issue fork panelizer-3352704
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
sker101 commentedhere's a patch that replaces the jQuery once with the new once library from core.
Comment #3
sker101 commentedNot sure if it's worth but hopefully this patch could address most of the tests.
There are two functional javascript tests that might fail due to upstream issue from Panels module
See https://www.drupal.org/project/panels/issues/3352958#comment-15002421
Comment #4
mingsongThanks @Shen for the patch.
May I ask a question about the access check in following codes?
Do we need to check the access in this case?
Comment #5
sker101 commented@Mingsong
I believe not because this query is triggered during a "post_udpate" hook.
I added the `accessCheck` method because it's required in Drupal 10.
Comment #6
mingsongThanks @Shen.
Comment #8
joseph.olstadall of this looks good and is needed
Comment #11
jan kellermann commentedThank you very much! I can confirm this patch also.
Notice for people who want to add this patch: Remove #3325442 before because it is included in this patch already.
Comment #12
damienmckennaThis looks good, thank you.
Comment #13
damienmckennaCommitted. Thank you.
Comment #15
zanematthew commentedNote for others, patch does not apply and current 4.x version still produces various once errors in the console `$(...).once is not a function`.
Comment #16
joseph.olstad@zanematthew, I'd say try the latest tagged release, no need for a patch now that it's released and included in the build, please rebuild your cache after upgrading to the latest release
composer require 'drupal/panelizer:^4.5'This will get you 4.5 or newer, 4.5 being just released today.
Comment #17
zanematthew commented@joseph.olstad I revisited this and it was another module causing the .once error. This update works as expected, thanks!