Hi @all,

I just mentioned that a view using the Display suite row plugin lacks the "Grouping data" settings during export. The "grouping" option is exportet, but "group_field" and "group_field_function" are not.

This leads to the following error, when the view is packaged in a feature and enabled on a fresh install:
Undefined index: grouping_fieldset in views_plugin_ds_entity_view->render()

I'd appreciate if someone may have a look at this problem...

Thanx in advance & cheers

hctom

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

swentel’s picture

Title: Views grouping data settings of Displa suite row plugin partially missing in views export » Views row options missing in views export
Status: Active » Needs review
FileSize
741 bytes

looks like every sub option was actually missing. Can you test with the attached patch, should fix it.

swentel’s picture

Status: Needs review » Fixed

I went ahead and committed this. I'll be adding tests for ds views integration at #1241936: Missing tests - in case there are still issues with this, add them to that issue.

Status: Fixed » Closed (fixed)

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

tim.plunkett’s picture

Status: Closed (fixed) » Needs review
FileSize
1.7 KB

I had to decide between reopening this or #1241936: Missing tests and opening a new issue. Hope this is okay.

option_definition() has to know about everything, event the nested stuff.
I'm not sure about the difference between $options['grouping'] and $options['grouping_fieldset']['grouping'] though.

swentel’s picture

Status: Needs review » Needs work

Hmm didn't know about that 'contains' key, interesting. The 'grouping' key is the checkbox to disable/enable that feature, fieldset is anything underneath it.

+++ b/views/views_plugin_ds_entity_view.inc
@@ -42,10 +42,35 @@ class views_plugin_ds_entity_view extends views_plugin_row {
+        'item_0' => array('default' => 'full'),
+        'item_1' => array('default' => 'full'),
+        'item_2' => array('default' => 'full'),
+        'item_3' => array('default' => 'full'),
+        'item_4' => array('default' => 'full'),

This set of items is dynamic depending on the pager limit. So this is hardcoded now. I'll have a look at it this weekend to make it dynamic.

tim.plunkett’s picture

Views is smart enough to not export default values, I just put everything into options_definition until the export looked clean. And yeah, I had a 5 item pager, makes sense.

swentel’s picture

So whether we put 1 or 10 default items, that doesn't really matter there ?

tim.plunkett’s picture

No, to the contrary. If we put one there, but there are 10 in the options_form, the last 9 of them will go into every export. Perhaps we'd need to do some introspection into the pager during options_definition, but I don't know that it works like that.

tim.plunkett’s picture

Status: Needs work » Needs review
FileSize
2.13 KB

dereine suggested using a custom export option function. This works beautifully.

tim.plunkett’s picture

FileSize
2.24 KB

Use 'bool' when appropriate.

swentel’s picture

Status: Needs review » Fixed

Seems to be working fine. Committed and pushed, thanks!

Status: Fixed » Closed (fixed)

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