I am getting this error when trying to create a custom style for my panels.

# Notice: Undefined index: style in _panels_stylizer_get_style() (line 95 of /hermes/bosweb/web249/b2494/glo.nimaweb/sites/all/modules/panels/plugins/styles/stylizer.inc).
# Notice: Undefined index: style in _panels_stylizer_get_style() (line 100 of /hermes/bosweb/web249/b2494/glo.nimaweb/sites/all/modules/panels/plugins/styles/stylizer.inc).

Files: 
CommentFileSizeAuthor
#7 panels-1082098-7-D6.patch870 bytesmikeytown2

Comments

_Nima_’s picture

I should add that the style works fine, I just get the error on my page...which is not very visually appealing :)

erdembey’s picture

Same here ...

erdembey’s picture

Status:Active» Needs review

My temporary solution is as follows;

- Open file "sites/all/modules/panels/plugins/styles/stylizer.inc",
- Browse to line 91 which contains;

function _panels_stylizer_get_style($plugin, $style_settings) {

- Add the following code;

    if(empty($style_settings['style'])){
        $style_settings['style'] = '';
    }

- Before the following line (around 92);

if (!empty($plugin['style'])) {

Finaly function _panels_stylizer_get_style should be as follows;

function _panels_stylizer_get_style($plugin, $style_settings) {
  if(empty($style_settings['style'])){
    $style_settings['style'] = '';
  }
  if (!empty($plugin['style'])) {
    return $plugin['style']->settings;
  }
  else if ($style_settings['style'] == '$') {
    return $style_settings['settings'];
  }
  else {
    ctools_include('export');
    $style = ctools_export_crud_load('stylizer', $style_settings['style']);
    if ($style) {
      return $style->settings;
    }
  }
}

I hope it solves the issue.
It seems the $style_settings is empty in most cases ...

Thanks.

merlinofchaos’s picture

Status:Needs review» Fixed

I think this only happens if a custom style was set up but not configured, so the style is invalid. I added a quick check to remove the notice, which seems to have no ill effects; any style in this condition shouldn't really do anything.

accesspoint’s picture

erdembey:

Worked Brilliantly!!! Thanks for posting!

Status:Fixed» Closed (fixed)

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

mikeytown2’s picture

Version:7.x-3.0-alpha2» 6.x-3.x-dev
Category:support» bug
Priority:Normal» Minor
Status:Closed (fixed)» Needs review
FileSize
870 bytes

Same issue with 6.x; stylizer module is disabled which is interesting.

NigelCunningham’s picture

Confirming that patch in #7 fixes it for me in 6.x.

NigelCunningham’s picture

Status:Needs review» Reviewed & tested by the community
merlinofchaos’s picture

Status:Reviewed & tested by the community» Fixed

Committed and pushed! Thanks!

Status:Fixed» Closed (fixed)

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

  • Commit 8b8492c on 7.x-3.x, pipelines, 7.x-3.x-i18n, 8.x-3.x by merlinofchaos:
    Issue #1082098: Notice about missing style in style settings.