A patch says a thousand words. I got that PHP notice and guess it originates from a copy&paste accident.

This issue is just about removing the error. It's up to others (more experienced) to asses, if the error handling is healthy.

CommentFileSizeAuthor
delete_flushed_unserialize_fix.patch413 bytesAnonymous (not verified)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ogi’s picture

Status: Needs review » Fixed

Good catch, thank you! Fixed in c564c74.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

x

interdruper’s picture

Issue summary: View changes
Status: Closed (fixed) » Needs review

Sorry for re-open this one, but the patch was incomplete. Here is what I got:

Notice: Trying to get property of non-object in DrupalFileCache->delete_flushed() (line 441 of filecache.inc)

... and again it's because this:

437        $cache = @unserialize($content);
438        if ($content === FALSE) {
439          continue;
440        }
441        if ($cache->expire != CACHE_PERMANENT &&
442            $cache->expire <= $cache_flush) {
443          @unlink($filename);
444        }

should be this:

437        $cache = @unserialize($content);
438        if ($cache === FALSE) {
439          continue;
440        }
441        if ($cache->expire != CACHE_PERMANENT &&
442            $cache->expire <= $cache_flush) {
443          @unlink($filename);
444        }

I can provide a patch against last dev if required.

ogi’s picture

Status: Needs review » Fixed

  • ogi committed 26d8076 on 7.x-1.x authored by interdruper
    Issue #1643548 by interdruper: Notice: Trying to get property of non-...

Status: Fixed » Closed (fixed)

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