Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've enabled the Authcache Panels Module and get the warning
Notice: Undefined index: settings in authcache_panels_pane_fragment_id()
Comment | File | Size | Author |
---|---|---|---|
#6 | 2293279-fix-undefined-notice-settings-in-panels.diff | 5.21 KB | znerol |
Comments
Comment #1
znerol CreditAttribution: znerol commentedInteresting. authcache_panels_pane_fragment_id($pane) only accesses
$pane->cache['settings']
if$pane->cache['method'] == 'authcache_panels'
. If you get that notice, it means that the$pane->cache
not consistent.I do not have any idea how this might have happened. Can you reproduce that on a fresh drupal instance?
Comment #2
fox_01 CreditAttribution: fox_01 commentedI got an idea. Maybe its because i'm using panels everywhere? I read that authcache not supporting panels not rendered through page manager at the moment.
I will try it on a fresh installation.
Comment #3
fox_01 CreditAttribution: fox_01 commentedFor now i can not reproduce the error without panels everywhere but i don't understand the behavior of the message exactly yet.
Any idea what i can try to do?
Comment #4
znerol CreditAttribution: znerol commentedComment #5
znerol CreditAttribution: znerol commentedReopening because it has been reported again #2353965: Notice: Undefined index: settings in authcache_panels_pane_fragment_id(. Please post any follow ups here.
Comment #6
znerol CreditAttribution: znerol commentedOk, figured that this notice may appear due to the usage of the equals-operator (
==
) instead of the identity-operator (===
). If$pane->cache['method']
contains a non-string value, the right side ('authcache_panels'
) is first converted to the appropriate type.If
$pane->cache['method']
containsTRUE
(boolean), the right side is converted to a boolean also and the condition as a whole will evaluate toTRUE
.The other case when this happens is if
$pane->cache['method']
contains0
(int).I have no idea whether something different than a string is allowed in
$pane->cache['method']
as per the panels API, but this is easily fixed by just using the correct operator. Let's do that in other panels related code also.Comment #7
znerol CreditAttribution: znerol commentedFiled #2353999: Use identity operator (===) instead of equality (==) where appropriate.
Comment #9
znerol CreditAttribution: znerol commented