Problem/Motivation
Hi,
We found two bugs in moderated_content_bulk_publish.js in the node-edit-form section (the enable_dialog_node_edit_form code path). They combine to make the Save button completely unresponsive after a failed validation.
Bug 1: mcbpDialogOpen flag is set unconditionally, but only reset when a dialog closes
The window.mcbpDialogOpen = true flag is set at the top of the click handler, before the conditions that check whether the moderation state is actually transitioning to "Published". When the state is NOT changing
to Published (e.g. Draft to Draft, or no moderation state at all), the dialog is never opened, its close callback never fires, and mcbpDialogOpen stays true forever.
On any subsequent Save click, the guard if (window.mcbpDialogOpen) { e.preventDefault(); return false; } fires and the button does nothing. This is the main user-visible symptom: click Save, get validation errors,
fix them, click Save again, nothing happens.
Fix: Move window.mcbpDialogOpen = true from before the dialog creation to inside each if branch, right before showModal(), so the flag is only set when a dialog is actually displayed.
Bug 2: The "Yes" button unbinds the click handler then triggers the same namespaced event
In the confirmation dialog's "Yes" button handler:
$("...#edit-submit").unbind('click.moderated_content_bulk_publish');
$("...#edit-submit").trigger('click.moderated_content_bulk_publish');
I added a gif with the expected behavior (the required fields popup appear) and after it only works the first time that I click the save b

| Comment | File | Size | Author |
|---|---|---|---|
| #2 | fix-save-button-after-validation.patch | 2.31 KB | adrianodias |
| issue with moderated_content_bulk_publish.gif | 2.17 MB | adrianodias |
Issue fork moderated_content_bulk_publish-3572014
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:
- 3572014-save-button-becomes
changes, plain diff MR !61
Comments
Comment #2
adrianodias commentedthis seems to fix the issue
Comment #4
joseph.olstadComment #7
joseph.olstadComment #9
joseph.olstadWe'll see if this holds up. It's in 3.0.0-rc6