On D9.3 and have recently updated to Metatag 8.x-1.18 and have just started to get this error.
Notice: Trying to get property 'build_info' of non-object in Drupal\views\Plugin\views\cache\CachePluginBase->generateResultsKey() (line 199 of /home/XXXXX/public_html/core/modules/views/src/Plugin/views/cache/CachePluginBase.php)
Followed by:
Error: Call to a member function getCurrentPage() on null in Drupal\views\Plugin\views\cache\CachePluginBase->generateResultsKey() (line 220 of /home/XXXXX/public_html/core/modules/views/src/Plugin/views/cache/CachePluginBase.php)
No idea what has caused this but started happening post Metatag module upgrade.
Issue is that Views no longer displays any preview result output.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | metatag-views-live-preview-cache-error-3255547-15.patch | 1.09 KB | eugene bocharov |
| #10 | Screen Shot 2021-12-23 at 10.54.17 PM.png | 186.8 KB | thomas kaisuka |
Comments
Comment #2
stephen ollmanComment #3
stephen ollmanOk uninstalling 'Metatag Views' resolves my issue and views preview returns.
I re-installed 'Metatag Views' and it broke again, so the problem certainly lies with this module.
Comment #4
stephen ollmanComment #5
Iker Pérez commentedHad the same problem upgrading yesterday and only got it back working downgrading to version 1.16, so I believe the error was introduced in version 1.17.
Comment #6
eugene bocharov commentedI see the problem too. On views preview the
\Drupal\views\Plugin\views\cache\Noneplugin is used and it doesn't contain view object.I'd suggest to not wrap 'none' cache plugin at all in the
\Drupal\metatag_views\MetatagViewsCachePluginManager.Something like this
Comment #7
eugene bocharov commentedComment #8
oxy86 commentedSame problem here on D9.3 and Metatag 1.18 when Metatag Views submodule is installed. Uninstalling the submodule or downgrading to 1.6 solves the problem. I will test the patch in #6 and report back.
Comment #9
oxy86 commentedHello, the patch from #6 solved the problem for me (Drupal 9.3 with Metatag 1.18 and metatag_views enabled). Thanks, Eugene!
Comment #10
thomas kaisuka commentedSame here, uninstalling the metatag_views sub module solved the issue. Optionally to avoid losing configurations, just downgrade to version1.16.
Using Drupal 9.3
Comment #11
matthijsSeems to work fine, thx!
Comment #12
glynster commented@Eugene Bocharov patch works and resolves the issue RTBC +1 using Drupal 9.3
Comment #13
glynster commentedSeems I spoke a little too soon. We are getting WOD on view pages:
If I force clear the cache it works and then refresh it breaks again.
Once I uninstall metatag_views the issue goes away.
Using Drupal 9.3
Comment #14
mahmoud barhouma commented#6 patch resolved problem
Comment #15
eugene bocharov commentedThank you @glynster for testing. Obviously,
getInstance()should be modified as well to avoid the problem on wakeup. Can you try this patch?Comment #16
wellsPatch in #15 resolves the issue for me as well, including for views data cached into and retrieved from memcache (i.e., using
__sleepand__wakeup).Comment #17
ahmad abbad commentedAs #13 mentioned there's an issue with metatag_views
Comment #18
oxy86 commentedPatch in #15 resolved the issue for me as well (Drupal 9.3, metatag 8.x-1.18 with Metatag: Views enabled).
Comment #19
eugene bocharov commentedJust hiding #6 patch to avoid confusing, as it cause a problem at wakeup. #15 should be used instead.
Comment #20
glynster commented@Eugene Bocharov confirmed your new patch #15 works like a charm using Drupal 9.3! RTBC +1
Comment #21
glynster commented@Eugene Bocharov seems there is still an issue:
Comment #22
eugene bocharov commentedI think the problem on wakeup is another issue with
MetatagViewsCacheWrapper, not related to borken preview, that we try to solve here. Patch #15 prevents using of wrapper MetatagViewsCacheWrapper onnonecache plugin. So it can't lead to the error in MetatagViewsCacheWrapper which is not used on preview.In the other hand, if we'll take a look at the MetatagViewsCacheWrapper::__sleep()
we can see, that property MetatagViewsCacheWrapper::plugin woun't be saved during serialization because of the fact that wrapping plugin $this->plugin obviously doesn't have property $plugin. And therefore it doesn't exist on wakeup. I suppose that __sleep and __wakeup should be removed from MetatagViewsCacheWrapper, then it will use ones from DependencySerializationTrait.
But we probably need a separate issue to target this issue.
Comment #23
damienmckennaComment #24
damienmckennaCommitted. Thank you all.
Comment #26
Anonymous (not verified) commentedI found this thread when seeking out a resolution to the problem I was having with Watchdog.
1. A page refresh would no longer update the list of Watchdog entries. It would typically need me to clear the cache before the most recent entries would be shown in the view.
2. The ability to delete all Watchdog entries was broken - I could click on Delete, then on Confirm, but the entries would not be removed from the view. However, they would be removed if I then cleared the cache.
After uninstalling the Metatag Views module the Watchdog view is back working as expected.
I've not installed the dev release yet, but hopefully the patch in that will also resolve the above issues.
Comment #27
wells@Janner interesting... I started noticing that behavior in the watchdog view recently as well but hadn't made the connection. It is always resolved for me with a cache rebuild though and I can't reliably reproduce it. Are you able to reproduce or does it happen (seemingly) randomly?
Comment #28
Anonymous (not verified) commentedThe issue with the Watchdog entries was consistent for me. It took either a manual cache clear or the regular cron to make newer entries appear or the deleted ones to be removed.
I see that an issue with a view created by the Simplenews module has also been linked with this issue here, so it's possible that the reach may be greater than is already realised.
See https://www.drupal.org/project/simplenews/issues/3255498
Comment #29
Anonymous (not verified) commentedComment #30
oxy86 commentedI've also noticed the same problem in the watchdog view (deleted log entries kept appearing until a manual drush cr) but could not imagine there is a connection with this issue of Metatag Views 8.x-1.18.
After applying the patch in #15, the issue has been resolved and the watchdog view works as expected.
I agree with @Janner about the potential reach of this issue. This strange watchdog behavior shows that it's not about broken view preview only.
Comment #31
ansam dweik commentedThanks, Patch #15 solved my problem.
Comment #32
Anonymous (not verified) commentedComment #33
baltazarz3 commentedConfirmed, patch #15 solved the problem. My watchdog table was broken too, just like #30.
Comment #34
damienmckennaSo is this working correctly for everyone with the current dev release or are there still problems? Besides the Search API problem.
Comment #35
wellsPreviews and watchdog are working normally for me from the dev release.
Comment #36
damienmckennaExcellent, thank you.
Comment #37
selinav commentedThank you patch #15 works.
Comment #38
_renify_ commentedIt works when im using this code
Comment #39
damienmckennaThis fix was released in 8.x-1.19, please update your sites accordingly. If you are still having problems with Views please open a new issue. Thank you.