When editing a View in Views UI, if I go to the Filters section, and choose the "Add" action, a dialog comes up. If I cancel the dialog, the Views UI thinks I have modified my view. I get the yellow box saying "You have unsaved changes.".

Also happens with "Sort" section add.

I haven't tested with Field section, since my view doesn't currently use Fields, or the other sections like Relationships, etc. But... suspect it might apply to all of them?

Comments

olli’s picture

Status: Active » Needs review
Issue tags: +VDC, +Needs backport to D7, +JavaScript
StatusFileSize
new2.33 KB

I think this same bug exists in 7.x.

jhodgdon’s picture

Status: Needs review » Needs work

I tested the 8.x patch in #1. It works great! I tested it manually using a variety of add and edit dialogs, and it correctly displayed or didn't display the "changed" message at the right times.

And you're right, the same bug exists in Views 7.x -- I just never noticed it before, amazingly, because I use Views all the time. In 7.x, incidentally, besides putting up the "changed" message, Views UI thinking the view has changed also makes the Save button visible. This behavior is not replicated in 8.x.

The code in this patch has a minor formatting problem:

+  public function __construct($changed) {
+    $this->changed = $changed;
+  }
   /**

Needs an extra blank line inserted here between the new __construct() function and the next function.

And here:

+      'changed' =>  $this->changed,

There is extra space in this line after ==>

amitgoyal’s picture

Status: Needs work » Needs review
StatusFileSize
new2.33 KB
new584 bytes

Please review updated patch with formatting fixes as per #2.

jhodgdon’s picture

Looks good to me! The code formatting is correct now, and I tested the patch with the same code in it previously (only changes were whitespace).

I hesitate to mark it RTBC because I am not Views maintainer... will ping someone in IRC to give it a final review.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

The fix looks perfect.

damiankloip’s picture

Yep, looks good to me too.

tim.plunkett’s picture

3x +1

alexpott’s picture

Project: Drupal core » Views (for Drupal 7)
Version: 8.x-dev » 7.x-3.x-dev
Component: views_ui.module » Code
Status: Reviewed & tested by the community » Patch (to be ported)

Committed 77b6167 and pushed to 8.x. Thanks!

damiankloip’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new1.78 KB

Here is a D7 port of that.

dawehner’s picture

Status: Needs review » Fixed

committed and pushed

  • dawehner committed c413309 on 7.x-3.x authored by olli
    Issue #2305807 by amitgoyal, damiankloip, olli | jhodgdon: Fixed...

Status: Fixed » Closed (fixed)

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

olli’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new646 bytes

This gives me a notice "Undefined property: view::$changed in views_ui_ajax_form() (line 2967 of sites/all/modules/views/includes/admin.inc)" when clicking "Cancel".

  • 6595b1a committed on 7.x-3.x
    Issue #2305807 Follow up by olli: Fixed Undefined property: view::$...
damiankloip’s picture

Status: Needs review » Fixed

Good catch, committed!

Status: Fixed » Closed (fixed)

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