Upgraded from 8.x-1.4 to 8.x-2.0-alpha4. Needed to use Patch in #7
After upgrade getting these 2 warnings in watchdog, referenced view does display correctly.
Warning: array_filter() expects parameter 1 to be array, null given in Drupal\viewsreference\Plugin\Field\FieldFormatter\ViewsReferenceFieldFormatter->viewElements() (line 90 of /app/web/modules/contrib/viewsreference/src/Plugin/Field/FieldFormatter/ViewsReferenceFieldFormatter.php)
and
Warning: Invalid argument supplied for foreach() in viewsreference_views_pre_build() (line 71 of /app/web/modules/contrib/viewsreference/viewsreference.module)
Reason is $this->getFieldSetting('enabled_settings') is returning NULL for me.
Attached the row from the paragraph table before and after the update.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 3061262-10.patch | 1.89 KB | nicolash |
| #9 | 3061262-9.patch | 1.88 KB | seanb |
| #9 | interdiff-7-9.txt | 1.84 KB | seanb |
| #7 | warnings_after_upgrade-3061262-7.patch | 2.12 KB | spokje |
| after.sql_.txt | 1.84 KB | spokje |
Comments
Comment #2
spokjeAttached patch remove the Warnings for me.
Comment #3
spokjeComment #4
andy-blumThis works for that file, but there's another spot that's also broken, line 146 of src/Plugin/Field/FieldWidget/ViewsReferenceTrait.php. It's the same array_filter() on NULL issue, combined with an invalid arg for the following foreach
Comment #5
andy-blumPatch that should address #4 as wellDidn't save right. See #6
Comment #6
andy-blumNew to the patch-making game, but it seems like d.o is stripping out the redundant parts of my patch? Use in combination with #2.
Comment #7
spokje@ablum d.o. doesn't strip out redundant parts, so there must be some other "funky" stuff going on there.
I'm pretty certain you saw: https://www.drupal.org/project/viewsreference/git-instructions on a (very) quick guide to patch-making?
Anyway: Here's a patch that combines #2 and #6.
I've also hidden the patches from the previous comments (just uncheck the display checkbox to the right of each one) to prevent loads of files confusing people on the top of this issue.
Comment #8
andy-blumThanks, @spokje, that patch worked perfectly. +1 for RTBC
Comment #9
seanbI think since PHP 7 is now a requirement for Drupal 8 we can make this a bit shorter. Could you check if the attached patch work as expected and RTBC if it does?
Comment #10
spokjeReplaced patch #7 with #9, put it on a production site, still no errors => RTBC.
Comment #11
nicolash commentedWasn't applying for me anymore, but approach works.
Comment #13
seanbFixed! Will roll a new release today.