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;
  }
}

Issue fork authcache-3389878

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

SilviuChingaru created an issue. See original summary.

SilviuChingaru’s picture

Title: Notice: Trying to get property 'timestamp' of non-object în AuthcacheNodeHistorySetting->get() » Authcache 7.x-2.x-dev tests does not pass against latest Drupal 7.x-dev

In #4 I reverted the changes to check if Authcache 7.x-2.x-dev passes the tests against the latest Drupal 7.x-dev version and not all of them are passing anymore.

SilviuChingaru’s picture

Title: Authcache 7.x-2.x-dev tests does not pass against latest Drupal 7.x-dev » Authcache 7.x-2.x-dev tests do not pass against latest Drupal 7.x-dev