I got: Warning: Illegal string offset 'options' in image_hover_effects_field_attach_view_alter() (line 124 of xxx/sites/all/modules/contrib/image_hover_effects/image_hover_effects.module).
after upgrading from PHP 5.6 to 7.1
I don't know if it is my right conclusion, but after I skipped numeric deltas the function worked as expected.
Please check.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | illegal_string_offset-3031911-4.patch | 1.02 KB | johan den hollander |
| image_hover_effects.patch | 554 bytes | promes |
Comments
Comment #2
jurriaanroelofs commentedCan you provide steps to reproduce this? I don't get this warning in my installation that is currently using PHP 7.2.10.
Comment #3
promesHello Jurriaan,
I switched several times from PHP 5.6 tot 7.1 and back.
With PHP 5.6 the page was shown and no error in the watchdog.
With PHP 7.1 I get this Dutch error on the screen:
Fout
Er is onverwacht een fout opgetreden. Probeer het later nog eens.
In English: Error, An unexpected error has occurred. Please try again later.
I found out, my patch isn't the correct solution.
I don't know this module, since I didn't build this site myself. So I don't know what this site is supposed to do with this module.
Also two other sites, using this module seem not to have a problem, so maybe the problem i caused by another module.
I will put back the site to PHP 5.6 and ask the sitebuilder for more info.
I changed the status.
Comment #4
johan den hollander commentedWe also experience this warning message when a logged in user is visiting the /user page.
Error: Cannot use string offset as an array in image_hover_effects_field_attach_view_alter() (regel 124 van /var/www/html/sites/all/modules/contrib/image_hover_effects/image_hover_effects.module).
Warning: Illegal string offset 'options' in image_hover_effects_field_attach_view_alter() (regel 124 van /var/www/html/sites/all/modules/contrib/image_hover_effects/image_hover_effects.module).
I created a patch which does a check if $element[$delta]['#path']['options'] is not empty.
Comment #5
johan den hollander commentedComment #6
promesJust tested: I confirm that with patch #4 the site works identical with PHP 7.1 as without this patch in PHP 5.6.
Johan thanks.
Comment #7
astonvictor commentedD7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.