- Issue created by @fenstrat
- Status changed to Needs review
almost 2 years ago 12:09am 14 February 2023 - π¦πΊAustralia fenstrat Australia
Here's the fix. This could probably do with a test as well.
We hit this with π The views filter needs to have cacheability metadata applied when using Views caching Fixed where workbench_access does a hook_views_post_render() and adds a cache tag.
- Status changed to Needs work
almost 2 years ago 3:59pm 15 February 2023 - π³π±Netherlands Lendude Amsterdam
So the type hints here are ancient and usually just mention 'array', without specifying if we mean a 'render array'. Following the code back from the call to
stripAdminAndAnchorTagsFromResults
this acts on the result of \Drupal\views\Plugin\EntityReferenceSelection\ViewsSelection::getDisplayExecutionResults which uses \Drupal\views\ViewExecutable::executeDisplay which DOES specify it returns a render array.So yes I agree, the method should assume it can get more than just an array of rows and the change makes sense.
But yeah, it needs a test. I could have sworn we had some for stripAdminAndAnchorTagsFromResults but can't find it.
- Status changed to Needs review
over 1 year ago 4:00am 23 March 2023 - π¦πΊAustralia acbramley
I spent quite a bit of time trying to find existing tests for this and there indeed doesn't seem to be any. In fact there doesn't seem to be any for the selection plugin at all, just executing an entity reference view display (DisplayEntityReferenceTest).
Here's a red/green patch combo. Not entirely convinced this is the right place for the test or test hook so happy to move those if needed.
The last submitted patch, 4: 3341448-4--test-only.patch, failed testing. View results β
The last submitted patch, 4: 3341448-4.patch, failed testing. View results β
- π¦πΊAustralia acbramley
Given all the failures we definitely need to move the pre_render, or add another state flag to trigger it.
- Status changed to Needs work
over 1 year ago 5:19am 23 March 2023 - Status changed to Needs review
over 1 year ago 4:53am 5 April 2023 - π¦πΊAustralia acbramley
Added a state guard to only add the cache tag when we want it.
The last submitted patch, 9: 3341448-9--test-only.patch, failed testing. View results β
- Status changed to RTBC
over 1 year ago 4:17pm 5 April 2023 - πΊπΈUnited States smustgrave
Tested following the steps in the issue summary
Added $output['#cache']['tags'][] = 'foo';
to a random hook_views_post_render() (didn't check view if so applied to all)
Create entity reference view for the Article tags field
Created an Article
Checked logs and noticed error. -
larowlan β
committed bd88cad2 on 10.1.x
Issue #3341448 by acbramley, fenstrat, Lendude, smustgrave:...
-
larowlan β
committed bd88cad2 on 10.1.x
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Committed to 10.1.x
Will backport once tests come back greened (which I've queued)
-
larowlan β
committed 4f3a6731 on 10.0.x
Issue #3341448 by acbramley, fenstrat, Lendude, smustgrave:...
-
larowlan β
committed 4f3a6731 on 10.0.x
-
larowlan β
committed 813b70ab on 9.5.x
Issue #3341448 by acbramley, fenstrat, Lendude, smustgrave:...
-
larowlan β
committed 813b70ab on 9.5.x
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Backported to 10.0.x and 9.5.x
- Status changed to Fixed
over 1 year ago 2:44am 20 April 2023 Automatically closed - issue fixed for 2 weeks with no activity.
- πΊπΈUnited States drupalevangelist Detroit, MI
Hi All,
I updated the Inline Entity Form module to version 8.x-1.0-rc15 and getting the following error when I go to the create node page that has an inline entity item:Error: Call to a member function bundle() on null in Drupal\views\Plugin\EntityReferenceSelection\ViewsSelection->stripAdminAndAnchorTagsFromResults() (line 289 of core/modules/views/src/Plugin/EntityReferenceSelection/ViewsSelection.php).
I also posted a comment here: https://www.drupal.org/node/2822764 β .
My site is running on D9.5.9, and on PHP 8.1
I will appreciate it if you kindly provide some insight.
Thank you,
Emdad - π¦πΊAustralia acbramley
@drupalevangelist please create a new issue in the queue with steps to reproduce. It sounds like your view is producing results that can't be loaded.