Noticed on a particular node page the following error message was being logged to watchdog:
Notice: Trying to get property of non-object in AuthcachePageManagerNodeViewTaskContextProvider->taskContext() (line 27 of /sites/all/modules/authcache/modules/authcache_page_manager/includes/AuthcachePageManagerNodeViewTaskContextProvider.inc).
Investigated the issue, and found that the cause was a Views pane that displays recent comments. The pane is essentially a standalone unit, has no arguments being passed to it. However, we do want to refresh the pane more frequently than the rest of the page, so Authcache P13n is being used.
Was able to fix the problem by checking if $page_arguments is empty, and returning the default array as is done in AuthcachePageManagerDefaultTaskContextProvider.
Please review the attached patch and let me know if there are any questions. Thanks.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | authcache-taskcontext_page_arguments-3056220-2.patch | 1.2 KB | sgdev |
Comments
Comment #2
sgdev commentedReviewed this a bit further and realized there were other panes (like "Recent poll") that were creating similar issues, but had information such as the current page as the only item in
$page_arguments.So I've made the patch more generic and just checking if
$nodeis an object. This seems to work from what I can see.Please let me know if you have any feedback or questions, thanks.
Comment #3
sgdev commentedAs a side comment, maybe this is an issue related to my Panelizer patch? Let me know if this has been noticed with Panels.
Comment #4
sgdev commentedAdding this issue as related since there are some similarities:
https://www.drupal.org/project/authcache/issues/2950501