Download & Extend

Property of non-object error with Stylizer preview

Project:Panels
Version:7.x-3.0-alpha3
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Stylizer preview of panel panes doesn't work. When pushing button, the following error is displayed:

* Notice: Trying to get property of non-object in template_preprocess_panels_pane() (line 1165 z /sites/all/modules/panels/panels.module).
* Notice: Trying to get property of non-object in template_preprocess_panels_pane() (line 1198 z /sites/all/modules/panels/panels.module).
* Notice: Trying to get property of non-object in template_preprocess_panels_pane() (line 1199 z /sites/all/modules/panels/panels.module).

Comments

#1

I have the same problem :(

#2

Same problem here, using Drupal 7.2, PHP 5.3.6 and PostgreSQL 9.0.4.

To reproduce, visit admin/structure/stylizer/add and simply fill out the forms as follows:

1) write a title and a description, and click Continue;
2) choose “Panel pane” from the pull-down menu, and click Continue;
3) choose the “Plain” basic style, and click Continue;
4) click on Finish.

The warning appears after clicking on Finish. The bug does /not/ occur if the chosen type is “Panel region” or if the basic style is “Rounded shadow box”.

#3

Just forgot to mention that the style is created anyway, and subsequent modifications seem to be saved correctly (although the warning appears also upon editing an existing style).

#4

Same problem here. Anyone knows what's wrong here? Thanks!

#5

Status:active» needs review

Those three lines used coding conventions which assume a variable was an object. I am not sure if it is a problem that the variable is not an object, but this patch should get rid of the warnings.

AttachmentSize
non-object-stylizer-preview-1115610-5.patch 1.4 KB

#6

Looking more closely at the code and where this code is called, this patch appears more appropriate.

AttachmentSize
non-object-stylizer-preview-1115610-6.patch 451 bytes

#7

Let's try this one last time. Number 6 breaks the view of a panel page because there is no consistency between the use of theme variables. Based on this section of panels_theme:

<?php
$theme
['panels_pane'] = array(
   
'variables' => array('output' => array(), 'pane' => array(), 'display' => array()),
   
'path' => drupal_get_path('module', 'panels') . '/templates',
   
'template' => 'panels-pane',
);
?>

The variable that they use throughout the mosule ($content) is not part of the panel_pane theme. But $output is only used in panels_stylizer_pane_preview. This time, I changed output to content since that seems to be what every other page uses.

AttachmentSize
non-object-stylizer-preview-1115610-7.patch 557 bytes

#8

Thank you very much for the patch, it worked.

#9

Status:needs review» fixed

Committed and pushed! THanks!

#10

Status:fixed» closed (fixed)

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

nobody click here