Problem/Motivation

Pressing Enter mistakenly can inadvertantly enable modules on /admin/modules

Proposed resolution

Two posible solutions:

  1. Disable Enter Key form submissions on the module enable/disable screen.
  2. Add a module enable/disable confirmation screen.

Remaining tasks

Test Patch

User interface changes

Disables the enter key submission of the module enable/disable form.

API changes

none.

Data model changes

none.

Original By chrisjlee

On the extend page (/admin/modules), disable the ability to press enter and submit the form.

This could cause inadvertent submissions, etc.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chrisjlee’s picture

Title: Disable 'enter' submission on projects page » Disable 'enter' submission on extend page
Thomas Brekelmans’s picture

Assigned: Unassigned » Thomas Brekelmans
Status: Active » Needs review
FileSize
960 bytes

I've created a patch which introduces a very simple new behavior in system.modules.js which prevents the form from being submitted when the enter key is pressed anywhere inside of it.

It's documented but still very concise, I hope I did everything correctly. :)

frob’s picture

Assigned: Thomas Brekelmans » Unassigned
Category: support » feature

This is more of a feature request, also un-assigning it.

lokapujya’s picture

Did a review before I realized this was a feature request. Normally enter should submit a form, but I can see in this case that it doesn't make sense for enter to submit the module list form. So, the only way someone could accidentally use 'enter' to submit the module list is if they make changes to a checkbox and then go to the search form and hit 'enter'. Even then, it's not a big deal because the page tells you which modules were enabled.

However, if this change ever happened, maybe if the "Save Configuration" button is highlighted, the submit should be allowed.

natanmoraes’s picture

Assigned: Unassigned » natanmoraes
Issue summary: View changes

I'll check this.

natanmoraes’s picture

I've rerolled the patch for it to work with the latest changes.

I'll also work on the highlighted stuff mentioned in #4

natanmoraes’s picture

I've updated the patch to handle focus on the submit button.

Please review.

pandaPowder’s picture

Status: Needs review » Needs work

I disagree with adding this change. I find it extremely useful to be able to submit forms with the enter key and I typically find that apps should not mess with default browser behavior if possible. I don't see any arguments on this thread that make me think this form should receive special treatment in this regard.

pandaPowder’s picture

Issue tags: +Accessibility

I also want to point out that this suggestion has accessibility concerns. If you have to use your mouse to submit the form that is a big accessibility concern (I realize that #7 mitigates that concern to some extent). Yet another reason why we shouldn't meddle with browser behavior.

frob’s picture

Status: Needs work » Active

Accessibility concerns aside (for the time being)

I would argue that the module (extend) page requires this to keep from inadvertently installing modules.
This should also be an issue on the permissions page.

mgifford’s picture

I can't see how this will cause an accessibility problem. In my testing of the patch in #7 it wasn't a problem. Just had to navigate to the bullet and hit enter while hovering focusing over the "Save configuration" button.

pandaPowder’s picture

@mgifford, what do you mean by "hovering"? If you're talking about a mouse, then that's an accessibility problem. If you're saying that you need to tab to the "Save configuration" button before you can submit the form then that could be a giant accessibility problem. There are a lot of checkboxes on that page and if someone had a disability that prevented them from quickly tabbing (such as if you use a mouth stick to hit the tab key) that could mean hundreds of tab key presses before you can submit the form. Again, I just don't think that we should mess with default browser behavior. Why is this form different than say the node add form? Why is accidental submission more of a problem on this form than it would be on any other form?

mgifford’s picture

I just edited this for clarification. No, I wasn't talking about using a mouse. This can still all be done with only a keyboard at least as I can see it now. There are pages like this & the permissions page that will be a pain for someone tabbing through the site as there is yet no pattern to allow keyboard only users to skip to the submit button. There isn't any way around this at this stage.

Not altering the browsers default behavior is a good argument against this patch.

I think it's different than the node add form simply as it can be so very, very long in comparison.

frob’s picture

I think a good solution to this problem is to have a confirmation page when enabling modules/setting permissions.

pandaPowder’s picture

yeah, maybe a confirmation page would solve all these issues more cleanly.

mgifford’s picture

Issue tags: -Novice

It could be a nice usability improvement to present a screen that summarizes the changes and seeks confirmation. This is becoming less of a novice issue though.

lokapujya’s picture

Probably, we should leave the page alone (at least in Core.) We shouldn't mess with the default behavior of the form. Someone might be using the page during a deployment and a confirmation would be annoying. I was originally less against the change because I could see someone typing in the search box and hitting enter, but the page is already permission protected.

frob’s picture

I would leave it alone in 7, but in 8 I don't think we should be worried about breaking auto deployments.

I bring this up because I have enabled the wrong module by mistake (by pressing enter) and not all modules have proper uninstall hooks.

pandaPowder’s picture

Could we disable the enter key only in the search box? Is that the real issue here? since that filter is client-side, I don't see any issues with disabling the enter key in the search box only. Actually, now that I think about it, maybe the search box just needs to be moved out of the form and into a separate form. I don't know the exact best practices on that, but I think that might address all the concerns or use the confirmation dialog.

mgifford’s picture

I think this will be dealt with in #2056089: UI problems on the Modules/Extend page.

frob’s picture

Issue summary: View changes

The other issue seems to be focused on the search form functionality. My concern is for the module enable form.

If a user checks a box to enable a module, then they have that form focused. Then if they hit enter, then the form submits and the modules are enabled.

A module enable confirm screen would do the trick. My preference is to disable the enter key, but that generally isn't considered a UX best practice.

I updated the issue body.

Status: Active » Needs review

Status: Needs review » Needs work

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.

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.

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.