Problem/Motivation
Warning: Creating default object from empty value in flexslider_optionset_load() (line 281 of E:\....\sites\all\modules\contrib\flexslider\flexslider.module).
Steps to reproduce
Not sure, currently running PHP 7.4.30, error appears in logs but is non-fatal. Now required to move to PHP 8.x which causes this error to be come fatal for the website.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3329884-4.patch | 679 bytes | dineshkumarbollu |
Comments
Comment #2
RBlackman commentedComment #3
sgroundwater commentedI hit the same error w/ PHP 8.x. I let AI help me with a possible fix. In case it helps others.
---
The error message indicates that the property "options" is being modified on a null value in the function flexslider_optionset_load().
To fix this issue, you can add a null check before attempting to modify the "options" property. Here's an updated version of the code that includes the null check:
In the updated code, we added an if statement to check if $optionset is not null before attempting to modify the "options" property. If $optionset is null, the modification will not be executed.
By including this null check, you can prevent the "Attempt to modify property on null" error.
Comment #4
dineshkumarbollu commentedProvided the patch changes suggested in #3, please review