Relatively clean install of Panopoly with the demo module installed, and I turned on the Dark Blue Background style for a pane. The class is applied cleanly and the styles apply correctly, but I'm getting the following error:

Notice: Undefined property: stdClass::$css_class in theme_panopoly_demo_dark_blue_background_render_pane() (line 25 of /srv/bindings/350db61e7eaf4a11b0c9b16d7cba242b/code/sites/all/modules/panopoly_demo/plugins/styles/dark_blue_background/dark_blue_background.inc).

It appears that $content->css_class does not exists prior to appending the new class. Adding $content->css_class = ''; to the line preceding the error appears to get rid of it. Should I submit a patch or something? Haven't done that before.

Comments

mrweiner created an issue. See original summary.

mrweiner’s picture

Also, I haven't tried the other two styles, but I'm assuming that the error would be present with those as well, since the code is structured the same.

dsnopek’s picture

A patch would be nice! But I don't think clearing it is the right solution, because it could also contain something initially.

In mvpcreator_theme, we just solved a similar problemt:

http://cgit.drupalcode.org/mvpcreator_theme/commit/?id=fdd75f0975c2b839d...

I think a solution like that would be best.

Thanks!

mrweiner’s picture

Version: 7.x-1.35 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new2.41 KB

Yes, that's a good point that it could contain something already. Prior to you mentioning that, I ended up implementing something similar to your suggestion. I modified it and turned it into a patch. Hopefully it works! Looks like it should apply cleanly.

dsnopek’s picture

I haven't tested this yet, but the code looks right! Thanks!

candelas’s picture

I just test it and works :)
Thanks @mrweiner!
Sorry @dsnopek for the 2duplicates/1day O.O
I will be more careful and now I go to make my features and test in my real site.

dsnopek’s picture

Status: Needs review » Fixed

Committed, thanks!

mrweiner’s picture

Sure thing!

Status: Fixed » Closed (fixed)

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