After update to latest devx, I opened a node view and just changed the title. There was already a red warning "The operator is invalud" (sic) without specifying what operator. I have a filter Type = Story, and tried to re-open that and save it again. No avail.

Googling for "The operator is invalud" gives two possibilities:

http://drupal.org/files/issues/views_validate_in.patch
http://drupal.org/files/issues/1207680_0.patch

Any ideas?

CommentFileSizeAuthor
#10 no_value_operator.patch596 bytesakoepke

Comments

Anonymous’s picture

On a nother display in the same view, I have a node reference field set to "not empty". Since the upgrade, I am no longer able to edit this field. It seems to be the cause of the error. I was finally able to remove it via the "filter and/or" feature, which luckily has a "remove" option.

Then, trying to re-add the filter, I get a 300s server time-out.

What's up with this? Reverted back to rc1.

merlinofchaos’s picture

Status: Active » Closed (duplicate)

Is this http://drupal.org/node/1207680 ?

I don't know where that string is coming from:

[merlin@furor views (7.x-3.x)]$ grep -R invalud *
[merlin@furor views (7.x-3.x)]$
ungabunga’s picture

Same error. Helped rollback to rc1.

akoepke’s picture

Priority: Normal » Major
Status: Closed (duplicate) » Needs review

I have had this same problem and it is not the same issue as being discussed in the other thread. Similar, but not the same.

I have had a look at the latest copy of Views dev (released today) and the misspelled string can be found.

[root@www views]# grep -Rn "invalud" *
handlers/views_handler_filter_in_operator.inc:362:      $errors[] = t('The operator is invalud');

In my case this error only appears on Views where I am using the IS NULL operator. The function causing the issue is as follows (handlers/views_handler_filter_in_operator.inc line 360)

 if (!in_array($this->operator, $this->operator_values(1))) {
      $errors[] = t('The operator is invalud');
    }

In my case $this->operator contains empty and $this->operator_values(1) contains Array ( [0] => in [1] => not in ).

The function $this->operator_values(1) only returns operators which require values. The empty and not empty operators don't and so it fails validation. If this line is changed so it includes a check against $this->operator_values(0) as well, then the validation fails further down with No valid values found (Line 384).

Looking at this validate function, there seems to be no support at all for the empty and not empty operators. Would it be best to just validate them at the start with a simple check and then leave the rest to those operators with values?

Adding in the following lines to handlers/views_handler_filter_in_operator.inc:, before the other operator check, has solved this issue for me.

if (in_array($this->operator, $this->operator_values(0))) {
      return $errors;
    }

This way if the operator is valid and does not require a value then no further validation is required. Does this sound like a good solution to the problem.

akoepke’s picture

comment removed

clashar’s picture

+1

dawehner’s picture

Status: Needs review » Needs work

Please always write a proper patch, it's much easier to review.

clashar’s picture

For me error occurs only when I add "Location:Country" to Fliter Views.
No problem if it's "Location:City", "Location:Province", "Location:Phone"

Should it be another issue?

akoepke’s picture

Status: Needs work » Needs review
StatusFileSize
new596 bytes

Hi dareine,

As requested, here is a patch file for those 3 lines. I have made it against the latest dev version which was released today (one with the spelling error corrected).

clashar’s picture

I've applied patch but it didn't help me

akoepke’s picture

Yep, your issue is different to mine so most likely a different cause :)

jocken’s picture

#10 worked for me, no errors!

dawehner’s picture

Title: Cannot save existing view: "The operator is invalud" (sic) » Cannot save existing view: "The operator is invalid"
Status: Needs review » Fixed

Rewrote the comment and commited the patch to both version. Thanks!

Status: Fixed » Closed (fixed)

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