I upgraded views from Views 3.x-7.x-alpha1 to views-7.x-3.0-rc1.zip (tried the dev version from 8.aug as well), and cannot find a way to revert override of a disaplay to default (master) values. In the older version of the views 3 UI (non overlay) there was a button "Use default".

Now in the overlay when editing i.e. overridden filter criteria, there is just choice of:
- Apply (this display)
- Cancel
- Remove

I would expect the "Use default" button here. If I select on the drop down list of the overlay window "All Displays (except overridden)" - it offers to update the default display - but the with overridden values.

Am I missing something?

Drupal 7.7, Chaos tools 7.x-1.0-rc1, searched the queue, but could not find anything.

Comments

dawehner’s picture

Status: Active » Fixed

There is now a select-box at the top, where you can choose the used display.

Jiri Volf’s picture

Yes, I noticed that select box - but the problem is, that when I select "all displays" - the content of the form stays the same as it was for the overridden values - and If I click Apply - all displays - it updates the default values - loosing the original default values for all other displays. So effectively - there is no way to revert back to default values - without changing them.

dawehner’s picture

Category: support » bug
Priority: Normal » Major

Good point this seems to me like a big regression.

Status: Fixed » Closed (fixed)

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

stevetweeddale’s picture

EDIT: I'm experiencing this too. Sorry to have to re-open! Thanks for all your hard work on views!

dawehner’s picture

Status: Closed (fixed) » Active

Why open it without any informations?

stevetweeddale’s picture

Apologies - I didn't have any new information to offer so I didn't bother with the 'Me too...'

I'm experiencing the same issue as the OP, and you only acknowledged it as 'big regression', after having marked it as fixed. There aren't any patches and I couldn't see anything in the git log so assumed it hasn't actually been fixed, and you left with that status inadvertently. Sorry if I missed something there!

Also apologies I can't offer a patch right now - what's the intended behaviour? That when you select 'all displays (except overridden)' the form values revert to the master? Or should still be a 'use master' button?

dawehner’s picture

The select-field is the intended behaviour. This part of the ui got changed in the new ui.

stevetweeddale’s picture

So the field values should revert to the master display values when you change the scope from "this display" to "all display's"?

Jiri Volf’s picture

It seems to me that changing form values on the select-box change (use for all / this display(override)) could be the expected behaviour of the form. I'm however still pretty new to drupal and unfortunately far from supplying patches.

I checked how this works in views 6.2 - if I edit e.g. a field, then there is an override button - if I click it - it flips to use default. The form content remains the same, the submit buttons change to update / cancel (for an overridden setting) and update default display / cancel (for a default setting). If I want to go back to default values without overriding them in views 6.2, i first have to click use default and then cancel. Then the values go to the default without being overridden.

The cancel button in 6.2 cancels changes made to the default form, but the settings still go back to default(master) values (just by pressing the use default). But the In 7.3 it just cancels all changes, regardless of the state of the upper default / override select box.

A simple solution could be to change the behaviour of the upper select box- so it worked similar to the button in 6.2 - that means - just by pressing it, it would change the state of default / overridden. It is however imo still a little bit confusing.

So the question is what is the best approach?
Not sure - as there are two groups of settings with different behaviour:
1. fields, sort criteria, filter criteria, relations - when you override one, all others in the group get overridden too (btw - wasn't it possible in 7x alpha1 to override individual fields?, cannot remember)
2. section "other" under advanced - where individual settings can be overridden (and may be other sections)

Option for 1 - there could be an option "use default" added to "add , rearrange" control (on the main view edit page). On the overlay edit box for individual fields there could be a warning, that when updating all displays, original master vaules will be lost.

Or may be another solution: add "remove override and use master values" to the bottom line of the overlay edit box.

Still confusing - as the master display is hidden by default - so the edit form was probably meant to be used for editing master values - in which case it is logical, that on changing top select-box - values from the master display should be reloaded. But then the overridden values would have to be probably stored in db, so we could switch back.

Still confusing to me. It seems to me that master display should be visible by default, and master values should be able to be changed only there. Then there should be some override/use default button on the fields, filters, relations, sort criteria and so on, and same buttons on the individual settings. If the field is not overriden - there would be no active edit link on the settings - this would also make it easier to see what is overridden and what isn't.

... just some ideas, I hope it isn't even more confusing now, but that's my best I can contribute now...

brightbold’s picture

I agree that in the midst of the many improvements in the new UI, this seems like a regression. I wouldn't go back to the previous toggle, but having a clear way to say that you wanted to remove overrides and use default/master values would be really useful.

Here's a use case:

  • I created a view with multiple displays and filtered on a different taxonomy term for each display.
  • Then I added a more complex filter to the master display, using two different filter groups and and/or settings.
  • But of course, because the different term meant every display was overriding defaults, my complex filter isn't inherited by any of the other displays.
  • So it would be simpler to remove the overrides on each display and then re-add the taxonomy filter setting, rather than having to re-create the complex filter in every display.
  • If, on each display, I set the part of the filter I overrode (taxonomy term) back to the default (no term chosen) and set it to Apply to all displays (except overridden) I can indeed get it to revert to the master values. But it isn't obvious that this will work, and I would assume that if I couldn't remember what bit had been overridden, I would end up changing the master values in the process of reverting my display.

So a really clear "remove overrides" option would be great.

bojanz’s picture

The whole business with the select box needs major re-evaluation. It even managed to trip me up.

dawehner’s picture

Linking another issue which shows that under certain cases this feature is horrible broken #1174588: Overriding 'Display access settings' changes all displays unless 'Access control type' is also overridden

drupal_was_my_past’s picture

Subscribe

asciikewl’s picture

What about in the dropdown for fields/filters/... where it currently has "add" and "rearrange" add a "reset to defaults" if the fields/filters/whatever is overridden?

Because I know drupal well and I'm really having a hard time right now on a view where I have to take the fields for 8 displays back to the default values.

tim.plunkett’s picture

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

It looks like there was some confusion between #3 and #6.

It was marked fixed in #1, but then #3 says it was an actual bug, but not reopened.

#11 seems like a good explanation of the issue.

tim.plunkett’s picture

Talked about this more with dereine in IRC. I think we're on the same page again.

In D6, the "Use default" button was on individual item edit pages, which was very confusing. An example of how it worked:

You have a default display with "Title" field and "Body" field. Your page display is overridden; "Body" is displayed as a teaser, and you've add "Updated Date". Then you decide you want to revert your "Body" field to the default, so you edit it and click the "Use default" button. Now, your "Updated Date" field is gone.

If we reintroduce the "Use default" button, I propose it only appear on the Rearrange page. When you click "Use default", all of the current display's fields will disappear and the defaults will be shown, giving you the chance to still hit cancel.

Now, the real discussion is if this should be a standalone button up by the dropdown, like it was in D6, or as a button along with Apply and Cancel at the bottom.

Also up for debate is the text of the button:
"Reset to default"
"Use default"
"Remove override"

dawehner’s picture

Issue tags: +override-problem

Just tagging to catch them all.

drewkeller’s picture

Ok, I guess I'm not going crazy because I could not find a way to revert an overriden view back to the default.

There are two work arounds I thought of.
* Try to duplicate all of the default settings for whatever section you are trying to revert and then apply to all displays from within the display that was overridden.
* Export the view, edit the exported text to remove the overrides, then reimport the view.

kartagis’s picture

Subscribe

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new3.67 KB

Here is an irc log:

[22:03] <timplunkett> dereine: two questions about http://drupal.org/node/1242892
[22:03] <Druplicon> http://drupal.org/node/1242892 => Where is "Use default" button? used to revert override to default (master) values => Views, User interface, major, active, 20 comments, 5 IRC mentions
[22:03] <timplunkett> one, what needs to be done to move the issue along?
[22:04] <timplunkett> two, how would the code actually work when it's decided to do it :)
[22:05] <dereine>  there are several issues with the override button
[22:05] <dereine> a) you can't simply revert back to default without overriding the default data
[22:05] <dereine> if you had overriden changed and submit the default is changed
[22:05] <dereine> (just tries to summarize it)
[22:05] <timplunkett> right
[22:06] <dereine> b) and there is the problem that the overrides for access and cache are totally not how you expect them
[22:06] <timplunkett> http://drupal.org/project/issues/search/views?issue_tags=override-problem
[22:07] <timplunkett> dereine: some of those are bugs, some are currently "works as designed" yet we want to change how it works to make it more useful
[22:07] <timplunkett> like b) is a bug
[22:07] <timplunkett> but a) functions the way it should. it's just bad functionality
[22:07] <dereine> timplunkett: do you have an idea how to bring the just revert back to default feature back?
[22:08] <dereine> timplunkett: indeed i think most of the time you actually want to not override the default
[22:08] <dereine> b) should be tackled with http://drupal.org/node/1174588
[22:08] <Druplicon> http://drupal.org/node/1174588 => Override on page access changes all displays => Views, Code, critical, needs review, 14 comments, 4 IRC mentions
[22:09] <dereine> timplunkett: as far as i remember you talked about adding a new button?
[22:09] <timplunkett> yes
[22:09] <-- jalama has left this server (Ping timeout: 245 seconds).
[22:09] <timplunkett> dereine: http://drupal.org/node/1242892#comment-5024776
[22:09] <Druplicon> http://drupal.org/node/1242892 => Where is "Use default" button? used to revert override to default (master) values => Views, User interface, major, active, 20 comments, 6 IRC mentions
[22:10] <dereine> i'm wondering whether it would be more consistent/easier to use to have a third option in the select
[22:10] <dereine> but it's probably also confusing to submit without chaing something
[22:10] <timplunkett> yes
[22:11] <dereine> but a select seems to be a bad UI for a toggle-mechanism
[22:11] <timplunkett> the options in the select just change the behavior of the submit button. they don't affect the data directly
[22:11] <timplunkett> it should be a button in between apply and cancel
[22:12] <timplunkett> well
[22:12] <timplunkett> "Apply (all displays)" changes to "Apply (this display)" when you change the dropdown
[22:12] <timplunkett> if there was a third option, and the text changed to "Reset to default", that would work for me
[22:13] <timplunkett> no new button, keep the select list dropdown, make the behavior clear
[22:13] <dereine> oh that's a good idea
[22:13] <dereine> ping merlinofchaos
[22:16] --> jalama has joined this channel (~jalama@cpe-75-185-6-195.columbus.res.rr.com).
[22:17] <dereine> 'All Displays', 'Revert to all displays', 'This @display...'
[22:17] <dereine> timplunkett: what do you think about this naming?
[22:17] <timplunkett> dereine: well the current ones are appended to Apply. I'm not sure that "Apply (Revert to all displays)" makes sense
[22:18] <dereine> timplunkett: oh i'm first thinking of the select part
[22:19] <timplunkett> oh yeah i think thats fine

Here is a first version of the patch

dawehner’s picture

Status: Needs review » Needs work
StatusFileSize
new5.21 KB

As this patch + test shows it does not work as expected.

Manual testing

* override the title (set a new value)
* "choose" revert to all displays and input some new title
* submit and you will see the default value
* press f5 and you will see the new title
* arg

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new6.48 KB

Okay you have to store the changed view in the cache.

Additional some changes according to a code review of chx.

dawehner’s picture

StatusFileSize
new6.98 KB

This patch only shows the revert option on overridden sections.

dawehner’s picture

StatusFileSize
new7.05 KB

Tim suggested to move default_revert to the bottom.

dawehner’s picture

StatusFileSize
new7.04 KB

Ups forgot to update to the string change.

bojanz’s picture

Status: Needs review » Reviewed & tested by the community

Let's get it in.

dead_arm’s picture

We've been using this patch on our sites, and it's a huge help. It still applies, and it'd be great to get this in.

dawehner’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/includes/admin.incundefined
@@ -2474,14 +2474,23 @@ function views_ui_standard_submit($form, &$form_state) {
     // the default display and saving values specific to this display.
-    $display = &$form_state['view']->display[$form_state['display_id']];

Mh this change might cause problems. See the reference patch.

+++ b/includes/admin.incundefined
@@ -2490,7 +2499,7 @@ function views_ui_standard_submit($form, &$form_state) {
-    $display = &$form_state['view']->display[$form_state['display_id']];

Same problem here.

dawehner’s picture

Status: Needs work » Reviewed & tested by the community

Rework the status to not forget the patch.

dawehner’s picture

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

With some feedback of bojanz and timplunkett i commited this patch to 7.x-3.x

Yeah one big step to 7.x-3.0
Thanks for everything helping on this issue.

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