Some themes override the submit <input> and renders a <button> instead. Such as Bootstrap theme.

This results in the JavaScript alert to appear even when hitting submit or preview.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Mohammed J. Razem’s picture

Status: Active » Needs review
FileSize
510 bytes

This due to a the selector being specific to <input>.

The patch attached adds <button> to the selector, as form submit actions can either be <input> or <button>.

Adrian Richardson’s picture

This patch fixes the issue for me. Tested OK using the Bootstrap and Shiny themes.

mkhamash’s picture

Status: Needs review » Reviewed & tested by the community

Solved the problem with bootstrap theme.

NWOM’s picture

Status: Reviewed & tested by the community » Closed (duplicate)
Related issues: +#2302683: Context is not used in the js behaviors

This fix is included in another patch. Marking as duplicate #2302683: Context is not used in the js behaviors

COBadger’s picture

Status: Closed (duplicate) » Reviewed & tested by the community

Reopening, as the patch in Context is not used in the js behaviors does not fix this problem for us.

The problem we're experiencing is that in a bootstrap subtheme, users clicking on the "save" button on a node/edit form are shown the popup warning.

The patch in https://www.drupal.org/node/2262093#comment-8758301 does solve the problem we're experiencing.

czigor’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

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