When I add a field, for example to contextual filters, I do not get an option to add the field only for that display. Only once the field is added, when I get the screen for configuring the field, do I get this option.

The result of this is that once I've added the field, and then overridden it for my current display, I have to go back to the default one and remove the field there. The settings are not copied over, so that's good, but the field is added. I have this on every installation of Views on D7, so it's not module or server related.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Could you try to update to 7.x-dev and see whether this is still broken there?

If yes there are proabably other issues as well, which describe this problem.

Ankabout’s picture

dereine, yes it still works that way with the latest dev.

bojanz’s picture

Everything about overriding needs revisiting :/

dawehner’s picture

#1176048: Remove button does not respect changing of the override select is probably a duplicate.

Feedback/review for this patch are highly welcomed, as on all patches in general.

It's true the overrides are currenty somehow horrible broken :(

Ankabout’s picture

Not exactly a duplicate, but probably the same cause of the problem. Will attempt the patch later and report back in that thread.

Ankabout’s picture

FileSize
31.81 KB
30.71 KB
37.55 KB
20.86 KB
15.83 KB

It doesn't look like that patch will make sense for me. It's not only a remove issue. Here are some screenshots of my workflow, taken as follows:

  1. Make default view (page)
  2. Add display (block)
  3. Add field for the block display, click "Apply"
  4. Select "this display only" and configure the field.
  5. Check default display, field is added there too.

Basically it comes down to the fact that you can override the settings of the field, but you can't override the field itself when you add it.

A workaround is that you first click on "rearrange", click "this display only", then save and then add the field. Screenshots attached.

dawehner’s picture

Issue tags: +override-problem

Just tagging to catch them all.

joel_osc’s picture

Just ran into this issue when adding a sort field using 7.x-3.x-dev from Oct. 24th. The first sort field you add within a view always gets added to all displays even if you choose override. My situation was like this:

Display 1: sort on field_1
Display 2: sort on field_2
Display 3: no sort

To set this up in views I had to:

1. Add sort on field_1 and select override when saving
- bug now takes affect and adds sort on field_1 to all displays
2. Edit sort on field_1 in Display 2 and set to override and save
3. Remove sort on field_1 from Display 2
4. Add sort on field_2 in Display 2
5. Remove sort on field_1 on Master, which then removes the sort on Display 3

Hope this info helps.

dawehner’s picture

Bumping this to a release blocker.

filijonka’s picture

Hi

I've been testing this but with the http://drupal.org/node/1176048 patch included and I think that with the handler added in that patch it also corrected this one.

dawehner’s picture

Version: 7.x-3.0-rc1 » 7.x-3.x-dev

It would be definitive cool if some more people could test whether it's still a problem of 3.x-rc3

Ankabout’s picture

Not fixed in RC3 for me, sorry :(

filijonka’s picture

Tried in RC3 and not working so most likely not in dev either. Must been some caching. I do have an idea so hopefully i manage to get an patch done today

filijonka’s picture

been debugging now and this is my conclusion:

When we make the submission it calls views_ui_standard_submit and there we call for the options_override.

In views_plugin_display.inc:

In options_override it calls the funtion set_override with argument section, in this case fields.
set_override do take two arguments, the section and a boolean $new_state with default value null.
So new_state gets a value fetched and will in this case always be true and what happends then for each options in the section is that it will be reverted to the defaults. So that is the error acording to me.

When looking around in the file I found this function: override_option($option,$value) that seems to actually do what we want in this case?

Maybe something like this, semicode

 function options_override($form, &$form_state) {
    //fetch options for the section
   $options = $this->defaultable_sections($form_state['section']);
   //for each option call for override_option
  foreach($options as $option){
     $this->override_option($option,$value);
  }

The problem for me is that I don't know what $value is, so therefor I can't really test it and see if this really is somewhat correct or if I'm totally wrong.

and just a thought, pehaps it would be better if we from the submit actually call directly to the options_overide function.

Ankabout’s picture

Isn't it simply the case that the workflow is the wrong way round? Right now I think it works like this:

1. You add a field (no override options in the UI)
2. You set the options for the field (here you have override options)

I'm guessing that step 1 already adds the field to all displays, and only once you do step 2, does the settings only apply to one display.

But then again, I'm no coder, so I might be completely wrong, or missing an important reason for this workflow.

tim.plunkett’s picture

Hmm. It would make sense to me if the override dropdown was present on the add field/filter/sort form.

dawehner’s picture

This issue would be definitive helpful for writing an issue summary. Just from reading #8 i assume the problem is the following:

* You can't override directly on the add item form
* Per default items aren't overridden

Is there anything additional which is a problem here? Please help and write a summary.

tim.plunkett’s picture

Views add field modal
Views field configure, set to override display
Views display, with field added to other display

tim.plunkett’s picture

To clarify my last comment, the dropdown in the second image has no effect. But what Ankabout suggests in #15 is adding the dropdown to the first image.

Ankabout’s picture

dereine, as far as I know that's it, as tim explains. I think that should solve the whole thing?

dawehner’s picture

Status: Active » Needs work
FileSize
3.46 KB

There was an issue some time ago which would allow to only store new fields once submit is clicked, this maybe have helped it.

But yeah it's probably right that you have this select available.

Here is a first version which DOES NOT WORK!

dawehner’s picture

Status: Needs work » Needs review
FileSize
24.26 KB
17.76 KB
8 KB
18.46 KB
21.67 KB
2.82 KB

Based on some problems i had to tackle on #1373174: Add ability to override entire grouping before adding settings i managed to implement this now...

There are some additional screenshots to show how it works.

tim.plunkett’s picture

This only works halfway.

If you choose to override before adding the field, it works great.

But if you don't choose to override before configuring, and then try to set it to override, it is still broken.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

I misunderstood what was actually happening underneath, I think this is good to go solves the problem nicely.

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

One less issue

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