Disable the "dialog on node edit form" when updating a published node without changing it's moderation state.

Created on 19 October 2023, about 1 year ago
Updated 15 July 2024, 4 months ago

Problem/Motivation

There's a config in the module that displays the following warning in a dialog when user edits the node and at the same time changes the moderation status from 'non-published' to 'published'.

The warning text: "Are you sure you want to publish this item?"

The config:

The warning dialog:

The problem here is that the config clearly says that the dialog will appear when "when state changes from non-published to published.".
However the dialog also appears when node is already published and user updates the node without changing its moderation status. i.e. from 'published to published'.

This is opposite of what the message says.

Following is the JS code responsible for this, the else-if condition to be specific:

                if ((cur_state == '' || cur_state == Drupal.t('Draft')) && (new_state == Drupal.t('Published'))) {
                  e.preventDefault();
                  confirmationDialog_publish.showModal();
                  return false;
                }
                else if ((cur_state == Drupal.t('Published')) && (new_state == Drupal.t('Published'))) {
                  e.preventDefault();
                  confirmationDialog_publish.showModal();
                  return false;
                }

Steps to reproduce

  1. Install the module
  2. Create a new node and publish it
  3. Try to edit and save the node again without changing the moderation state

Proposed resolution

  1. Either remove the message from a 'published-to-publish' state change
  2. Or, add an additional config which enables/disables the message on 'published-to-publish' state change

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇮🇳India dipakmdhrm

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024