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.

Comments

PROMES created an issue. See original summary.

jurriaanroelofs’s picture

Can you provide steps to reproduce this? I don't get this warning in my installation that is currently using PHP 7.2.10.

promes’s picture

Status: Active » Postponed (maintainer needs more info)

Hello 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.

johan den hollander’s picture

StatusFileSize
new1.02 KB

We 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.

johan den hollander’s picture

Status: Postponed (maintainer needs more info) » Needs review
promes’s picture

Just 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.

astonvictor’s picture

Status: Needs review » Closed (outdated)

D7 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.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.