Problem/Motivation

Moving to PHP 7.4 we noticed these warnings:

    Warning: Creating default object from empty value in views_handler_filter_selective->get_oids() (line 320 of views_selective_filters/views_handler_filter_selective.inc).
    Warning: Creating default object from empty value in views_handler_filter_selective->get_oids() (line 321 of views_selective_filters/views_handler_filter_selective.inc).

Proposed resolution

Initialize the display on the cloned view to create the object that is attempting to be set.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

joelpittet created an issue. See original summary.

joelpittet’s picture

Status: Active » Needs review
Issue tags: +PHP 7.4
StatusFileSize
new634 bytes

Here's the patch for review

jplana’s picture

Status: Needs review » Reviewed & tested by the community

I can confirm this patch #2 worked for me.

joelpittet’s picture

Status: Reviewed & tested by the community » Needs review
Related issues: +#2633548: Attached displays should not be executed in dummy view
StatusFileSize
new860 bytes

Unfortunately @jplana and I ran into an issue with my patch, it seems to squash the error but has some side-effects where it spits out multiple of the same value.

I still think it's correct to initialize the handler instead of just building a fake stdClass object to squash the error.

Here's another patch that seems to not have the side effects of initializing all the displays.

I pulled out the original issue that introduced the lines and there was a set_display() in the patch but removed on commit #2633548: Attached displays should not be executed in dummy view
But the set_display() causes the same bug duplicating the options. (at a glance it's multiplying the options by the number of displays). So this patch just initiates the current display's display handler... manually.

joelpittet’s picture

Status: Needs review » Fixed

Thanks @jplana, I've committed this to the dev release.

  • joelpittet committed 208ac03 on 7.x-1.x
    Issue #3152283 by joelpittet, jplana: get_oids() trying to create a...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

donquixote’s picture

The fix is a bit strange. Why do we assign an object by reference?