Authcache 7.x-2.x-dev tests do not pass against latest Drupal 7.x-dev

Created on 26 September 2023, about 1 year ago
Updated 27 September 2023, about 1 year ago

node_last_viewed() can store it's data with FALSE for users that did not viewed that content yet, not objects with a timestamp properties.

Access a node after cache was cleared and look at $history object in AuthcacheNodeHistorySetting::get() with debuger, you will heve records like:
$history['23'] = FALSE;

The check in AuthcacheNodeHistorySetting::get():

if (isset($history[$nid])) {
  $tsmap[$nid] = $history[$nid]->timestamp;
}

will throw a Notice: Trying to get property 'timestamp' of non-object.

Proposed resolution is to elaborate the check to:
if (isset($history[$nid])) {
  $tsmap[$nid] = 0;
  if (isset($history[$nid]->timestamp)) {
    $tsmap[$nid] = $history[$nid]->timestamp;
  }
}

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇷ðŸ‡īRomania silviuchingaru

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024