- go to admin/structure/types/manage/article/display, make sure selected formatter for 'body' field is 'Default' - if not, set it to 'Default' and hit 'Submit'
- change formatter for 'body' field to 'Trimmed', don't 'Submit' but hit the 'Edit settings' cogwheel button at the end of the 'Body' row.
- instead of the settings form for the 'Trimmed' formatter, you get the one for the 'Default' formatter (which has no settings, thus empty form)

Attached patch updates Field UI code for the new behavior of #limit_validation_errors (rightly) introduced in #763376: Not validated form values appear in $form_state.

I set up to write a test for that, but it turns out that the bug is JS-only, so no amount of simpletesting would have helped catch this.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yched’s picture

yched’s picture

Updated patch. I initially thought it was OK, but the 'Cancel' button within the 'formatter settings' form needs the same fix.

yched’s picture

Doh @ copy/paste error in the comment.

tstoeckler’s picture

+++ modules/field_ui/field_ui.admin.inc
@@ -840,8 +840,9 @@ function field_ui_display_overview_form($form, &$form_state, $entity_type, $bund
           '#value' => t('Cancel'),
+++ modules/field_ui/field_ui.admin.inc
@@ -840,8 +840,9 @@ function field_ui_display_overview_form($form, &$form_state, $entity_type, $bund
           '#value' => t('Cancel'),
...
+          // Do not check errors for the 'Edit' button. We still need the value

Should this not be "Do not check errors for the 'Cancel' button."?

Powered by Dreditor.

yched’s picture

re #4 - yup, fixed in #3 (crosspost)

effulgentsia’s picture

Status: Needs review » Reviewed & tested by the community

I did not test the OD manually, but I trust that yched did. It makes total sense, and there is no down-side in adding a validation requirement, especially if the value is then used by the submit handler, so this is pretty much a no-brainer.

I set up to write a test for that, but it turns out that the bug is JS-only, so no amount of simpletesting would have helped catch this.

Does this actually require testing of any JS code (i.e., browser-specific quirkiness)? Or simply of a multistep AJAX process? If the latter, please help get this in: #789186: Improve drupalPostAJAX() to be used more easily, leading to better AJAX test coverage. Then, we can add test coverage to this issue.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Too bad about the test coverage. :\ Committed to HEAD. Thanks!

yched’s picture

Thks webchick.

re eff #6 : a test for this would involve two successive ajax submits, which, IIRC, is out out reach of the current drupalPostAJAX().
An enhanced version that doesn't break the flow by leaving you with a raw array of ajax commands would certainly make this more doable.

effulgentsia’s picture

Being able to do multiple successive AJAX submits in simpletest is EXACTLY what #789186: Improve drupalPostAJAX() to be used more easily, leading to better AJAX test coverage is about :)

Status: Fixed » Closed (fixed)

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

effulgentsia’s picture

Status: Closed (fixed) » Needs review
FileSize
851 bytes

We need more tests for this form, and now that #789186: Improve drupalPostAJAX() to be used more easily, leading to better AJAX test coverage landed, we can write them (whenever someone has the time to do so). In the meantime, another bug that surfaced is when you "Manage Display" of an Article, then change the Image format to "hidden", then back to "Image", you get an AJAX error dialog. Here's a fix for that.

Bojhan’s picture

So can anyone review this and mark it RTBC?

yched’s picture

Status: Needs review » Reviewed & tested by the community

Away from my coding env, cannot write tests right now, but patch #11 is good, syntax for the #limit_validation_errors value is incorrect. Bug should only have minor consequences in itself. - er, not. Bug causes a PHP fatal error...

Alan D.’s picture

The thread seems a bit confusing to me (status wise), but I discovered this bug in a Drupal 7.0-alpha7 (2010-Sep-16 ) install with some custom code. This was post #7 commit (August 29, 2010 - 06:12).

The AJAX error was:

<em class="placeholder">Recoverable fatal error</em>: <em class="placeholder">Argument 2 passed to drupal_array_get_nested_value() must be an array, string given, called in C:\bin\drupal\drupal-7.0-alpha7\includes\form.inc on line 1007 and defined</em> in <em class="placeholder">drupal_array_get_nested_value()</em> (line <em class="placeholder">5724</em> of <em class="placeholder">C:\bin\drupal\drupal-7.0-alpha7\includes\common.inc</em>).

And patch #11 resolved this nicely.

webchick’s picture

Title: Field UI 'formatter settings' form broken » Write tests for the Field UI formatter settings form
Priority: Critical » Major
Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

To stop the critical regression, I have committed this patch to HEAD. But I am not committing any more patches to this area of the code until we get tests here.

Begrudgingly downgrading this to only "major", even though not one but two critical issues surfacing here as a result of holes in test coverage borders on yet another critical bug all by itself.

yched’s picture

@webchick : I know it's frustrating, sorry about that. Now that the hard refactoring work on Field UI "manage display" is done (and that #789186: Improve drupalPostAJAX() to be used more easily, leading to better AJAX test coverage is in), writing a full fledged test suite for that screen is the next item on my todo, when I come back to business - in a fortnight or so...

Note that #886152: All fields are hidden after the administrator newly configures a view mode to not use 'default' display has an initial set of tests for the screen.

sun.core’s picture

Priority: Major » Normal

Since only tests remain, demoting to normal.

effulgentsia’s picture

I agree with the "normal" designation, since I think via other issues, test coverage of this page has already improved anyway. Will let yched decide, however, whether to submit more, or to close the issue.

yched’s picture

More tests are coming up - almost ready, stumbled on a technical issue with submitting forms with image button in tests. Will post more about this when other hot issues have settled down.

Meanwhile, agreed with 'not major'.

Tor Arne Thune’s picture

Version: 7.x-dev » 8.x-dev
Category: bug » task
Issue tags: +Needs backport to D7

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

  • webchick committed 10fca34 on 8.3.x
    #896162 by yched: Fixed Field UI 'formatter settings' form broken.
    
    
  • webchick committed a8a7a02 on 8.3.x
    #896162 follow-up by effulgentsia: Fix for fatal error in Field UI...

  • webchick committed 10fca34 on 8.3.x
    #896162 by yched: Fixed Field UI 'formatter settings' form broken.
    
    
  • webchick committed a8a7a02 on 8.3.x
    #896162 follow-up by effulgentsia: Fix for fatal error in Field UI...

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

  • webchick committed 10fca34 on 8.4.x
    #896162 by yched: Fixed Field UI 'formatter settings' form broken.
    
    
  • webchick committed a8a7a02 on 8.4.x
    #896162 follow-up by effulgentsia: Fix for fatal error in Field UI...

  • webchick committed 10fca34 on 8.4.x
    #896162 by yched: Fixed Field UI 'formatter settings' form broken.
    
    
  • webchick committed a8a7a02 on 8.4.x
    #896162 follow-up by effulgentsia: Fix for fatal error in Field UI...

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

  • webchick committed 10fca34 on 9.1.x
    #896162 by yched: Fixed Field UI 'formatter settings' form broken.
    
    
  • webchick committed a8a7a02 on 9.1.x
    #896162 follow-up by effulgentsia: Fix for fatal error in Field UI...

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.