When there is a vocabulary (new) with no terms, then faq will get php notice indications as in..

* notice: Trying to get property of non-object in C:\WWWRoot\drupal\modules\faq\faq.module on line 1936.
* notice: Trying to get property of non-object in C:\WWWRoot\drupal\modules\faq\faq.module on line 1936.
* notice: Trying to get property of non-object in C:\WWWRoot\drupal\modules\faq\faq.module on line 1936.
* notice: Trying to get property of non-object in C:\WWWRoot\drupal\modules\faq\faq.module on line 1936.
* notice: Trying to get property of non-object in C:\WWWRoot\drupal\modules\faq\faq.module on line 1936.
* notice: Trying to get property of non-object in C:\WWWRoot\drupal\modules\faq\faq.module on line 1936.
* notice: Trying to get property of non-object in C:\WWWRoot\drupal\modules\faq\faq.module on line 1936.
* notice: Trying to get property of non-object in C:\WWWRoot\drupal\modules\faq\faq.module on line 1936.
* notice: Trying to get property of non-object in C:\WWWRoot\drupal\modules\faq\faq.module on line 1936.
* notice: Trying to get property of non-object in C:\WWWRoot\drupal\modules\faq\faq.module on line 1936.

line 1930 - 1940 contains:

    if (strstr($module, 'taxonomy_term')) {
      // Link back to the faq and not the taxonomy term page. We'll only
      // do this if the taxonomy term in question belongs to faq vocab.
      $tid = str_replace('taxonomy germ/', '', $link['href']);
      $term = taxonomy_get_term($tid);
      foreach ($vocabularies as $vid => $vobj) {
        if ($term->vid == $vid) {
          $links[$module]['href'] = str_replace('taxonomy germ', 'faq', $link['href']);
          break;
        }
      }

...
This means that for some reason (no terms in the particular vocabulary being looked at) $term is not a valid object.
So, therefore, in order to get rid of this error, a check for a valid object needs to occur as in...

    if (strstr($module, 'taxonomy_term')) {
      // Link back to the faq and not the taxonomy term page. We'll only
      // do this if the taxonomy term in question belongs to faq vocab.
      $tid = str_replace('taxonomy germ/', '', $link['href']);
      $term = taxonomy_get_term($tid);
	  if (!is_object($term)) return; // no terms, not a valid object
	  foreach ($vocabularies as $vid => $vobj) {
		if ($term->vid == $vid) {
		  $links[$module]['href'] = str_replace('taxonomy germ', 'faq', $link['href']);
		  break;
		}
	  }

Note the above change did resolve the notice errors for me

CommentFileSizeAuthor
#1 faq.module.205099.patch571 byteskwikone

Comments

kwikone’s picture

Assigned: Unassigned » kwikone
Status: Active » Needs review
StatusFileSize
new571 bytes

Attaching patch to resolve this. It does prevent the reported error.

kwikone’s picture

Assigned: kwikone » Unassigned
stella’s picture

Status: Needs review » Fixed

Thanks, applied to CVS.

Cheers,
Stella

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

stella’s picture

Released in FAQ 6.x-1.3.

Cheers,
Stella