I've enabled the Authcache Panels Module and get the warning

Notice: Undefined index: settings in authcache_panels_pane_fragment_id()

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

znerol’s picture

Interesting. 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?

fox_01’s picture

I 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.

fox_01’s picture

For 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?

znerol’s picture

Status: Active » Closed (cannot reproduce)
znerol’s picture

Status: Closed (cannot reproduce) » Active

Reopening because it has been reported again #2353965: Notice: Undefined index: settings in authcache_panels_pane_fragment_id(. Please post any follow ups here.

znerol’s picture

Status: Active » Needs review
FileSize
5.21 KB

Ok, 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'] contains TRUE (boolean), the right side is converted to a boolean also and the condition as a whole will evaluate to TRUE.

The other case when this happens is if $pane->cache['method'] contains 0 (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.

  • znerol committed 1814c90 on 7.x-2.x
    Issue #2293279 by fox_01, joelpittet: Fix Notice: undefined index:...
znerol’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.