When importing views, or when deleting flags, invalid views may result. This patch implements the validate() method to guard against this. Users won't be able to save or preview such views until they fix the problem.

CommentFileSizeAuthor
#7 vldt.diff8.29 KBmooffie
missing-flag.diff1.95 KBmooffie

Comments

mooffie’s picture

Version: 7.x-2.x-dev » 6.x-2.x-dev

(Of course, it's for D6 as well.)

mooffie’s picture

This validate() method doesn't run for existing views. We may also want to make sure such views fail gracefully (one user reports getting a WSOD in this case).

mooffie’s picture

Nate, are you fine with this patch?

This patch is "safe". It doesn't alter existing code. It just adds validation.

This validate() method doesn't run for existing views.

(I wasn't clear here: I meant to say that validate() isn't called when a view is merely run. It's called when one saves a view or previews it.)

mooffie’s picture

Status: Needs review » Closed (duplicate)

I'm marking this a duplicate of #969102: Don't specify a default flag.

mooffie’s picture

Status: Closed (duplicate) » Active

Re-opening this issue.

mooffie’s picture

#994674: Flag does not exist was marked a dup of this issue.

mooffie’s picture

StatusFileSize
new8.29 KB

I'm going to commit the following patch.

What was added?
- Relationships now have a get_flag() method that does validation at "run time".
- query() methods now exit if get_flag() returns NULL. get_flag() prints a message in case of missing flag.

mooffie’s picture

Title: Views validation: non-existent flags » Views validation: guard against non-existent flags
mooffie’s picture

Priority: Normal » Critical
Status: Active » Fixed

Committed.
http://drupal.org/cvs?commit=468574
http://drupal.org/cvs?commit=468578

(Marking this 'critical', as not having this guard results in WSODs.)

Status: Fixed » Closed (fixed)

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