Hi all,

I'm using 7.x-1.x-dev together with Views 7.x-3.x-dev.

When I create a view showing teasers of a content type, for which I have a Content Template, I get the error mentioned in the title for each result. The error refers to line 932 in the contemplate.module file.

This occurs when the View is configured in such a way that the 'Display Links' option is disabled.

This seems logical when looking at the code :

$vars['content'] = array(
  'body'        => $vars['content']['body'],
  'links'       => $vars['content']['links'],
);

I figured that if links display is disabled in the view settings, $vars['content']['links'] would be empty at this stage.

Changing line 932 to the following code, solved things for me.

'links'       => (isset($vars['content']['links']) ? $vars['content']['links'] : FALSE ),

Feel free to correct my code there, as I might not be using best-practice coding standards.

I should also read up on how to create a patch. Promise I'll do so. In the meanwhile, maybe someone else can patch / commit this.

Best regards,
Wouter

Files: 
CommentFileSizeAuthor
#1 contemplate-1191688.patch1.03 KBdgtlmoon

Comments

dgtlmoon’s picture

StatusFileSize
new1.03 KB

try this one..

dgtlmoon’s picture

Please test patch

dgtlmoon’s picture

Actually, i'm not sure what you mean, could you attach an export of your view?

tim.plunkett’s picture

Status:Needs review» Needs work
+++ b/contemplate.moduleundefined
@@ -941,7 +941,7 @@ function contemplate_preprocess_node(&$vars) {
         $vars['content'] = array(
           'body'        => $vars['content']['body'],
-          'links'       => $vars['content']['links'],
+          'links'       => (isset($vars['content']['links'])) ? $vars['content']['links'] : FALSE

Why are you assigning $vars['content']['body'] and $vars['content']['links'] to itself?