Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've just done this on a view:
- I started editing it and got a validation error that there was no content type set on the node type filter. (Not sure why; maybe the content type got removed?)
- As I edited this filter, I thought, 'hang on, that shouldn't be defaulted, that should be specific to display A on this view'.
- I tried to save the view and can't, because while display A is now ok and validates, the default display still has missing data.
However, I don't see how I can get to this data to fix the problem, hence I can't save the view and my settings are lost.
Comment | File | Size | Author |
---|---|---|---|
#19 | 1345934-19-8.x.patch | 2.51 KB | damiankloip |
#17 | 1345934-17.patch | 2.48 KB | damiankloip |
#17 | views-error-screenshot.png | 16.07 KB | damiankloip |
#15 | 1345934.patch | 2.39 KB | dawehner |
#9 | 1345934-2.views_.display-validation-errors.patch | 2.9 KB | joachim |
Comments
Comment #1
rdmillner CreditAttribution: rdmillner commentedI had a similar issue since updating. I solved this problem by going to the field that was giving the issue on a display that I knew would validate and changing "Configure filter criterion for:" and changing it to all displays. Then I went back and made sure the other displays were overriding that to show what they needed to and this solved the problem.
Comment #2
merlinofchaos CreditAttribution: merlinofchaos commentedUgh. That's a case where you need to go into the Settings and check the box that makes the master (formerly default) display always appear.
In my opinion, anyone who actually uses Views a lot should do this regardless. The master display is a very important piece of information.
Comment #3
DjebbZ CreditAttribution: DjebbZ commentedI would have said the same thing than merlinofchaos. Go in the Settings and make the master display always appear.
Comment #4
dawehnerThe patch from http://drupal.org/node/1343888#comment-5267556 would at least allow to access the default display directly via url.
Comment #5
joachim CreditAttribution: joachim commented> check the box that makes the master (formerly default) display always appear
Would there be any way to detect this sort of situation, and if the master display is hidden, tell the user to go enable it? I didn't know this option existed :)
> In my opinion, anyone who actually uses Views a lot should do this regardless.
Agreed!
Comment #6
dawehnerOne suggestion:
* Make the default tab available via url
* When the validation fails on a display always show this display and mark the background of the tab as red.
This would allow people to fix the error, some oppinions?
Comment #7
dawehnerLet's mark it as major as there is a temporary workaround and people can use views though.
Sure this should be fixed.
Comment #8
dawehnerOkay here is a first approach, some critics are welcomed, the current code does add foo all the time to test it.
Maybe someone could come up with better colors.
There is also a color needed for opened tab has errors.
Comment #9
joachim CreditAttribution: joachim commentedThe patch seems to cause the master display to be visible at all times, even with the setting turned off.
Here's an updated version of the patch with some tweaks to comments & a title attribute added to the tab so you get hover text.
> +.views-displays .secondary a.error {
If this is just for the tab, would using #views-display-menu-tabs be better?
Comment #10
joachim CreditAttribution: joachim commentedSorry, it's still needs work because of the master display thing...
Comment #11
dawehnerYeah there was a reason it was set to active ...
Well the other css use the same selector
Do you agree in general with the approach?
Comment #12
joachim CreditAttribution: joachim commentedWhat I mean is that the master display shows even if I comment out the 'foo' error, on any view.
> Well the other css use the same selector
Do you mean other things use the new red colouring, or other things use #views-display-menu-tabs?
Yes, the approach in general seems fine -- if the master display fails validation, show it, and highlight it as being the source of the problem.
Comment #13
alberto56 CreditAttribution: alberto56 commentedSee #1419978: Allow saving of a view when there are validation errors on the master display (comment 4) for steps to reproduce a recoverable validation error in this context.
Comment #14
dawehnerJust wondering, maybe you overlooked this debugging line?
Comment #15
dawehnerSo remove the debugging and update status.
Comment #16
dawehnerThis patch definitive needs a review by someone else.
Comment #17
damiankloip CreditAttribution: damiankloip commentedThe patch works as it should; the logic is fine and classes are added to the markup correctly. I think it's just the css that is the problem :) As meantioned in IRC, I think it should be a red outline and not a background color. How about this?
Comment #18
dawehnerLet's get it in
Thanks for the visual improvement and testing!
Comment #19
damiankloip CreditAttribution: damiankloip commentedHere is one for 8.x
Comment #20
aspilicious CreditAttribution: aspilicious commentedThey look identical!
Comment #21
dawehnerLet's get it in!