the whole site stopped working after updating for this module
log error
Auf der Website ist ein unvorhergesehener Fehler aufgetreten. Bitte versuchen Sie es später nochmal.
TypeError: explode(): Argument #2 ($string) must be of type string, array given in explode() (line 19 of modules/contrib/views_attach_library/views_attach_library.module).
views_attach_library_views_pre_render(Object)
I flushed cache with no luck and disabled the module for the the sake of getting rid of the error.
| Comment | File | Size | Author |
|---|---|---|---|
| Screenshot 2024-03-19 at 09.29.54.png | 444.03 KB | waed94ep |
Issue fork views_attach_library-3432027
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:
- 3432027-fix_typeerror
changes, plain diff MR !3
Comments
Comment #2
waed94ep commentedComment #3
waed94ep commented--
Comment #4
waed94ep commentedComment #6
raveen_thakur51 commentedStill not able to reproduce, what/how happened here!!
Comment #9
mohd sahzad commentedComment #10
raveen_thakur51 commented@Mohd, You are checking case only when it comes as string but, the error raised is for -
$libraries = $view_config['display_options']['display_extenders']['library_in_views_display_extender']['attach_library'];
if (is_string($libraries)) {
for second argument, If the error persists, (still i am not able to reprouce) The code won't goes upto your changes. It still shows error.
Could you please let me know more about error, how you reproduced it. I was keeping an eye on it from yesterday.
Can you address the error for me. Please & Thank You.
Comment #11
raveen_thakur51 commentedComment #12
raveen_thakur51 commentedCan you please share your test results?? Thank You!!
Comment #13
raveen_thakur51 commentedComment #14
raveen_thakur51 commentedMIstakenly updated/added comment in ticket bio.
Comment #15
lazzyvn commentedHmm I'm retesting carefully with drupal 10.2 PHP8.2 but I can't reproduce this problem. I changed explode function, you can try with dev version or you goto your view configuration and save it again
Comment #18
david.muffley commentedThis occurs on my site as well. You can replicate it by installing version 2.0.3, saving a view with a value in the attach_library field, and then upgrading the module to 2.0.4. That version changed the array lookup where the string is stored (it removed a second `attach_library`) but didn't update any existing information. I suggest adding an update hook to fix the data stored in every view.
Comment #20
lazzyvn commented@david.muffley Yes, you're right. there are new fixes in the development version, which will make it work, no need to create an update hook to fix all views. please confirm
Comment #21
themusician commentedThe new 2.0.5 release fixed this issue where I was seeing it.
Comment #22
lazzyvn commented