Problem/Motivation

Hi, this module uses a subscription to the change event to determine if the form has been edited, but some specific updates do not trigger this event, so the core has its own formUpdated event for form updates.

One example where this causes a problem is editing in CKEditor5, but switching to the formUpdated event will solve the problem.

This will also remove the iteration of all CKEditor4 instances.
And will solve the problem when one of these instances calls a dialog, although it is not in a form.

Steps to reproduce

  1. Create a form with CKEditor5.
  2. Include modified-form-alert.js to the form.
  3. Enter something in CKEditor5.
  4. Try to close the browser tab, it will close successfully without warning.

Proposed resolution

Subscribe to formUpdated event instead of chage in modified-form-alert.js

Remaining tasks

  1. Fix.

User interface changes

None.

API changes

None.

Data model changes

None.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

kksandr created an issue. See original summary.

kksandr’s picture

Assigned: Unassigned » kksandr

kksandr changed the visibility of the branch 2.1.x to hidden.

kksandr’s picture

Assigned: kksandr » Unassigned
Issue summary: View changes
Status: Active » Needs review

This event was added to editors in version 8.0-alpha3~680 11 years ago, so it is compatible with Drupal 8 which the module claims to support.

anruether’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the MR! I applied the commits as patches to our project and it works fine.

jeroent’s picture

Status: Reviewed & tested by the community » Fixed

Merged to 2.1.x. Thanks!

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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