I'm getting Notice: Undefined variable: columns in include() (line 28 of ...panels/templates/panels-add-content-modal.tpl.php).

And the accompanying: Warning: Invalid argument supplied for foreach() in include() (line 28 of ...panels/templates/panels-add-content-modal.tpl.php).

Patch to come.

Comments

twistor’s picture

Status: Needs review » Active
StatusFileSize
new2.02 KB

Rather than check in the tpl file, just make sure everything is initialized in add-content.inc

This also fixes:

twistor’s picture

Status: Active » Needs review
twistor’s picture

Status: Active » Needs review
StatusFileSize
new2 KB

Arg. A little overzealous with removing variables.

zilverdistel’s picture

Status: Needs review » Needs work

Thanks for looking into it! Some further thoughts on the patch, which fixes the problem for me ...

+++ b/includes/add-content.incundefined
@@ -43,6 +43,7 @@ function template_preprocess_panels_add_content_modal(&$vars) {
+  $vars['columns'] = array();

We only really need this line to solve the issue, I think.

+++ b/includes/add-content.incundefined
@@ -56,9 +57,7 @@ function template_process_panels_add_content_modal(&$vars) {
-    foreach (range($columns) as $column) {

Strange how this got in the code. Function range() needs at least 2 arguments.

+++ b/includes/add-content.incundefined
@@ -76,12 +75,10 @@ function template_process_panels_add_content_modal(&$vars) {
-  $vars['description'] = isset($vars['content_type']['description']) ? $vars['content_type']['description'] : $title;
+  $vars['description'] = isset($vars['content_type']['description']) ? $vars['content_type']['description'] : $vars['title'];

This is definitely a bug, but maybe it should be addressed in a separate issue/patch?

+++ b/includes/add-content.incundefined
@@ -76,12 +75,10 @@ function template_process_panels_add_content_modal(&$vars) {
-  error_log('test');

It's better not to touch code in your patch that doesn't involve the issue ...

justin.koh’s picture

Using Panels 7.x-3.2 on a new-ish site, panels was working fine but today discovered this problem. Not sure when the problem started happening but patch in #3 works for me.

twistor’s picture

twistor’s picture

Status: Needs work » Closed (duplicate)
Ivanhoe123’s picture

#3 worked for me
Thanks!

Ivanhoe123’s picture

Issue summary: View changes

Updated issue summary.