Problem/Motivation

We have a use-case where we want to display a custom confirmation message when a node gets scheduled for publishing.

This currently overlaps with default messages (provided by the module in scheduler_node_presave()) and makes it very hard to hide them.

Proposed resolution

Would you be interested in adding a new configuration option to show/hide the scheduler messages depending on that setting? This could apply per content type or a global setting.

Comments

mbovan created an issue. See original summary.

berdir’s picture

We can't just translate the message or so, because our "message" is part of the node template that is always displayed and not a drupal_set_message() message.

jonathan1055’s picture

Hi mbovan,
Yes, sounds like a very reasonable request to have that option, and make it per content type.

jonathan1055’s picture

Status: Active » Needs review
StatusFileSize
new167.47 KB
new9.06 KB

Hi mbovan and Berdir,
I have added this new option at the Content Type level for flexibilty. By default it will be on to replicate current behavior. I have also been meaning to add a message when scheduling to unpublish as this is missing. However, to avoid giving two messages if both dates are set they are combined into one. I have also wanted to get rid of the text "This post" (I think that must be a very old message) and I've now replaced it with the title.

If shown, the message will be either

{title} is scheduled to be published {date}
{title} is scheduled to be unpublished {date}
or
{title} is scheduled to be published {date} and unpublished {date}


The new option is in the 'Node Edit Page' fieldset
show message

jonathan1055’s picture

Issue summary: View changes
StatusFileSize
new13.27 KB

I have added test coverage for the new option. This patch will fail as I have purposely set the default to false in scheduler.settings.yml

Status: Needs review » Needs work

The last submitted patch, 5: 3024686-5.show-or-hide-message.patch, failed testing. View results

jonathan1055’s picture

Status: Needs work » Needs review
StatusFileSize
new13.19 KB

Here's the patch with correct default value.

jonathan1055’s picture

@mbovan @Berdir
Any chance of your feedback? I added this option specifically for you. This is the last issue I am waiting on before I release Scheduler 8.x-1.2 so if you have a chance to look at this it would be good. Its been 5 days since I posted the patch, and I'd like to commit this and tag the next release by 28th May. Or if you don't have time just let me know.
Thanks

  • jonathan1055 committed bbb6573 on 8.x-1.x
    Issue #3024686 by jonathan1055: Provide a configuration option to show...
jonathan1055’s picture

Status: Needs review » Fixed

It's a week since my patch, and no review, hence no complaints, so I have committed this.

Status: Fixed » Closed (fixed)

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

arlingtonvoicellc’s picture

Just want to provide some feedback. When using the option with the Automatic Entity Label module, the message that comes out reads:

%AutoEntityLabel% is scheduled to be published Tuesday, March 1, 2022 - 11:06pm.

jonathan1055’s picture

Hi arlingtonvoicellc,
I don't think the problem with you message was introduced by the changes in this issue. You can create a new issue and we can investigate.