Move the summary jQuery plugin to it's own file and clean it up. Currently there is too much binding/unbinding going on.
Take formUpdated out of there and to it's own file while making it better: #1636992: form.js' formUpdated event is unreliable/incomplete
Put fillUserInfoFromCookie behavior somewhere else maybe?

Replace form.js with 3 files and update the references to the proper file in the rest of the code.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Kiphaas7’s picture

BONUS: Investigate if adding basic events and detach makes sense, as described in #1763812: [META] Provide complete attach/detach with basic events.

nod_’s picture

tag

rballou’s picture

The following modules use the summary functionality provided by `form.js`:

  • block
  • book
  • comment
  • filter
  • menu
  • node
  • path
  • system

A couple questions regarding how to handle updating their library information:

  1. The block module does not explicitly require the summary functionality (it checks if it exists first and exits if not), should I update that to include it as a dependency?
  2. Most of the modules specify `drupal.form` as a dependency. Is this the same as `core/misc/form.js`?
nod_’s picture

1. don't think so, i'd have to dig into but it's a small thing.
2. yes

:)

rballou’s picture

Status: Active » Needs review
FileSize
7.31 KB

Sweet, figured out how the drupal.form bit worked :)

Anyway, here's an initial patch that: removes the summary jQuery code to it's own file, core/misc/drupal.summary.js; updates the system library info; updates the modules above so that there library info calls include the new file; and changes the bindings in the summary code to on/off calls. I have not rolled out any updates for the other two pieces of form.js code. Also I only added drupal.summary as dependencies, I did not check if they code was using the other functionality and remove drupal.form as needed.

I currently have this code push out to github at: https://github.com/robballou/drupal/tree/8.x-form-js

nod_’s picture

Status: Needs review » Needs work

The last submitted patch, 1685146-refactor-form-js.patch, failed testing.

nod_’s picture

Just posting the code I have so far, needs some more work but it's a good re-start. The changes made in #5 are not included in this patch, but they should!

this patch will fix #1636992: form.js' formUpdated event is unreliable/incomplete and #1515734: form.js' 'formUpdated' behavior is slow because it binds to each element rather than delegating also, not closing yet, some people might complain about the scope creep :þ

This patch needs to be applied on top of #1705618-26: Double click prevention on form submission.

Wim Leers’s picture

Priority: Normal » Critical

So is #1636992: form.js' formUpdated event is unreliable/incomplete then a duplicate of this one?

In either case, this blocks #1636992, and #1636992 is critical, so marking this as critical.

nod_’s picture

nod_’s picture

Issue tags: +JavaScript

Should have left that one as critical to get people working on it :þ

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.

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.

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.

andypost’s picture

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

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.

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.