Scenario 1:

Add a new view, clicking through the wizard.
Change the style plugin.
Click through the options form.
Hit save.

Default style options are available in $view->style_options, $view->style_plugin->options, and from $view->display_handler->get_option('style_options').

Scenario 2:

Add a new view, and in the wizard, change the style plugin.
Hit save.

Default style options are available in $view->style_plugin->options. $view->style_options and $view->display_handler->get_option('style_options') are empty.

CommentFileSizeAuthor
#2 1429426.patch460 bytesdawehner

Comments

tim.plunkett’s picture

Component: Code » Wizard

Switching all of my code to use $view->style_plugin->options works just fine, but views created without visiting the style options form (aka created via the wizard) will always have an empty $view->style_options.

dawehner’s picture

Component: Wizard » Code
Status: Active » Needs review
StatusFileSize
new460 bytes

I just tryed to exactly understand what you observed:

Scenario 2:
Add new view => insert name => change style => continue and edit => look at $plugin->options
Then the plugin had the default options given in option_definition.

Scenario 1:
Add new view => insert name => change style to table => continue and edit => change style to grid => $plugin->options had the options given in option_definition.

Which of the three ways did you used in your code? Here is a patch which marks style_options as deprecated

tim.plunkett’s picture

Here's the issue for fullcalendar where I was doing it wrong and switched it with success.
#1429458: Views aren't set up properly from wizard

But I still think it's weird that the options are set on the display when submitted via the form, but not from the wizard.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Okay, so #3 should be ignored, I was just accessing the options wrong.

This issue needs a better title to reflect the patch in #2.

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

Yeah one less issue. Committed to 7.x-3.x

Status: Fixed » Closed (fixed)

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