I've been getting watchdog messages from adv forums as follows:

Notice: Trying to get property of non-object in advanced_forum_forum_load() (line 125 of /var/www/drupal-prod/sites/all/modules/advanced_forum/includes/core-overrides.inc).

and

Notice: Undefined property: stdClass::$tid in advanced_forum_forum_load() (line 130 of /var/www/drupal-prod/sites/all/modules/advanced_forum/includes/core-overrides.inc).

at page: [SITE]/forum/ - so the main forum view where there's no taxonomy selected. This ONLY happens at [SITE]/forum/ not at [SITE]/forum - note the trailing slash.

I think it's because there's a disconnect on the value passed in in that case. If no tid is passed into advanced_forum_forum_load(), then the default values get set because tid is NULL, so that works fine - but...

The problem is with the trailing slash we get a load in which the tid passed in is NOT unset - it's an empty string not NULL. Tid isn't unset, so the stuff meant to keep tid from getting left off never gets called so we end up trying to reference nonexistent values.

So one line to change - just the one - should fix this. In core-overrides.inc, at 93: if (!isset($tid)) { change this to if (empty($tid)) {

CommentFileSizeAuthor
#1 advanced_forum-2218889.patch383 bytesBastlynn
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Bastlynn’s picture

FileSize
383 bytes

Patch against 7.x

Bastlynn’s picture

Status: Active » Needs review
podarok’s picture

Status: Needs review » Fixed

nice catch
commited
Thanks!

  • Commit 40af8f0 on 7.x-2.x authored by Bastlynn, committed by podarok:
    Issue #2218889 by Bastlynn: Fixed Watchdog messages: Trying to get...

Status: Fixed » Closed (fixed)

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