Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Either the error was coming with upgrade to 7.10 or it was there before w/o me recognising it.
When the WYSIWYG Filter module is activated and I go to admin/structure/block/add I'll get the following error:
Fatal error: Unsupported operand types in /var/www/vhosts/lokarabia-stage.de/httpdocs/modules/filter/filter.module on line 683
which code is
$filter->settings += $filter_info[$name]['default settings'];
It seems some settings probably have a wrong format, but I'm quite new to Drupal and therefore cannot easily locate the error or wrong setting format.
Tell me if and how I can be of further help to debug it.
Comments
Comment #1
mariomaric CreditAttribution: mariomaric commentedHi.
I have fresh D7.10 and WYSIWYG Filter 7.x-1.6-rc2 enabled and activated in one text format and I cannot reproduce your error..
Comment #2
jazzitup CreditAttribution: jazzitup commentedI could reproduce the issue. I tried it with PHP 5.3 and PHP 5.5:
Disabling the module helps as a workaround to bring back the site.
drush dis wysiwyg_filter && drush cc all && drush cron
Comment #3
jazzitup CreditAttribution: jazzitup commentedThis is definitely a wysiwyg_filter's issue:
I replaced the following line 718 inside of the filter.module:
... with this:
The output:
If I replace again the aforementioned line 718, but this time with:
I temporarily fixed the issue and see no PHP errors.
Wysiwyg should fix the $filter->settings before passing it to filter_list_format().
Comment #4
jazzitup CreditAttribution: jazzitup commentedMarking this bug as critical, since it breaks the site.
Comment #5
Jorge Navarro CreditAttribution: Jorge Navarro commentedThe problem also comes by using HTML Purifier. #3 Fixes the issue... there should be some text format settings causing this problem, patching core is always a problem.
Comment #6
drupalnewie @berfi CreditAttribution: drupalnewie @berfi commentedAfter moving site from folder to another folder, i face this similar issue. The numbers in here didn't solve my problem.
Comment #7
xtfer CreditAttribution: xtfer as a volunteer commentedI don't think this is a an issue with this module. The filter settings are saved and retrieved by Drupal core. If the unserialise operation fails its probably because the encoding has changed. This may happen because one server is running mbstring set differently to another.
Comment #8
stefan.r CreditAttribution: stefan.r commentedSetting to NW given #6 and #7.
Comment #9
geek-merlinIs this still an issue for someone?
Comment #10
geek-merlinIf yes, please post how to reproduce this on a clean install.
Comment #11
jazzitup CreditAttribution: jazzitup commentedI ran into this issue again, but under different setup: currently I don't use WYSIWYG Filter, but still can reproduce this bug.
@xtfer: You were right. The issue is related to serialize/unserialize. My unserialize function fails to process the longest serialized string:
string(5017)
Localhost watchdog throws the following notice:
Setup from above works well on my production server, but as soon as I migrated the site to my localhost, I faced this issue again. Both versions of PHP are the same: v7.3.7. Mbstring configuration on both sites displays the same settings. This is the line where the issue is reflected, but the culprit is somewhere else (
filter.module
, line 723):Any idea how to avoid this annoying issue?
Comment #12
jazzitup CreditAttribution: jazzitup commentedI've just found what causes my issue!!
Since long time ago I've been following certain steps in order to migrate a site to localhost. One of the steps was to replace all appearances of
www.xyz.com
tomy.local
within the mysql dump. When doing it manually (aggressively), of course it may cause some unpredictable issues like this. Within thesettings
column offilter
table and withinvalue
column of thevariables
table there are numerous appearances of the original domain name such ass:31:"www.xyz.local";
. Of course, my real domain name was 31 characters long and when I replaced it withmy.local
,s:31
was no longer relevant! Therefore unserialize() complained and the whole site went down!Perhaps the original issue was also not related to WYSIWYG module. I hope my finding may help somebody out there.
Comment #13
geek-merlinOK i guess we all had times where we shot in our knees like this ;-). Great you shared...
Comment #14
geek-merlinHups, others may have different shootings...