Views 3 requires each options key to be declared in the option_definition() method in order for a style plugin's settings to be exported. Currently, the data style plugin does not have its values exported properly -- this patch fixes that.

Comments

zzolo’s picture

Status: Needs review » Fixed

Thanks @yhahn. Commited: http://drupal.org/cvs?commit=348772

Status: Fixed » Closed (fixed)

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

Will White’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new838 bytes

This issue has regressed as a result of this commit. New patch attached.

zzolo’s picture

Hi @Will White. Thanks for the patch.

I have not tested this, but your patch is changing the default value to be in the wrong format for the change in the data_source form item to a select, which just takes a string value as its default.

Most of the code in that commit is a workaround to support backwards compatibility for that change to a select, as its values structure is different than the multiple select, which is the format everyone with existing views has.

Have you tested this with an upgrade?
Have you tested this with Views 2?

Overall, just thinking about this, it doesn't seem right. But I could easily be missing something here.

yhahn’s picture

I have not tested this, but your patch is changing the default value to be in the wrong format for the change in the data_source form item to a select, which just takes a string value as its default.

This is not true. The options returned by option definition array should be a keyed array where the keys refer to a variety of attributes of that option, one of which is its default value. Please see the base class views_object() from which all views handlers and plugins are derived:

  /**
   * Information about options for all kinds of purposes will be held here.
   * @code
   * 'option_name' => array(
   *  - 'default' => default value,
   *  - 'translatable' => TRUE/FALSE (wrap in t() on export if true),
   *  - 'contains' => array of items this contains, with its own defaults, etc.
   *      If contains is set, the default will be ignored and assumed to
   *      be array()
   *
   *  ),
   *  @endcode
   * ...
   */
  function option_definition() { return array(); }
tmcw’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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