I get the following error when I try to output the teaser for a node. I really need to be able to print thumbnail pictures along with the title of the node. But having a warm time in doing so. If there is another solution or a patch that I could use, it would be greatly appreciated. Been slugging about with this one for days now. Here is the output error:

Notice: Undefined property: stdClass::$teaser in template_preprocess_similarterms() (line 568 of /httpdocs/sites/all/modules/similarterms/similarterms.module).

I don't mind working around the teaser thing and finding someway to output the node title and a [thumbnail] picture that is in the node as well.

CommentFileSizeAuthor
#5 notice_error-1302684-5.patch617 bytesmgifford

Comments

djmy’s picture

+1

amfriedman’s picture

+1

manimaran.g’s picture

Me too have this problem , Please help me

mgifford’s picture

Notice: Undefined property: stdClass::$teaser in template_preprocess_similarterms() (line 587 of /DRUPAL7/sites/all/modules/contrib/similarterms/similarterms.module).

Think it may just be a matter of checking to see if the variable exists, like:

--- a/sites/all/modules/contrib/similarterms/similarterms.module
+++ b/sites/all/modules/contrib/similarterms/similarterms.module
@@ -583,7 +583,7 @@ function template_preprocess_similarterms(&$variables) {
   $nodes = $variables['nodes'];
   if ($nodes) {
     foreach ($nodes as $node) {
-      if ($variables['display_options'] == 'teaser') {
+      if ($variables['display_options'] == 'teaser' && isset($node->teaser)) {
         $teaser = ' - ' . $node->teaser;
       }
       else {
mgifford’s picture

Status: Active » Needs review
StatusFileSize
new617 bytes

Rolled this patch against the the repo. Stuff has been moved about. Looks good.

takim’s picture

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