I'm using behat to test the scheduled publishing and unpublishing of nodes. behat-drush-endpoint allows me to use the drush driver to run these tests against remote sites. The command it invokes drush behat create-node ... is supposed to return the created node in JSON, but when I set a scheduled publish date it also returns the message set by this module which makes the JSON invalid. This patch just prevents that message from being set when in a CLI. Maybe this should be handled on the Drush side, but this was the path of least resistance for me. If nothing else maybe this patch will be helpful to someone else.

Comments

chasingmaxwell created an issue. See original summary.

chasingmaxwell’s picture

StatusFileSize
new790 bytes
jonathan1055’s picture

Status: Active » Needs review

Interesting. Does core use this to also inhibit messages when a node is saved in this way?
I've set to 'needs review' to try it against the simpletests.
New features would have to be implemented in our 8.x version, which we are working on at the moment.

pfrenssen’s picture

To suppress messages while running on CLI is not really a pattern that I have seen in Drupal core or other modules. Other people might also rely on the messages being present e.g. when running cron through drush. I do a lot of continuous integration work and the messages are usually very helpful to know what has happened.

I think this wouldn't benefit the majority of our users, and might impact a few.

There might be other avenues to approach this (e.g. in drush itself), but in practice I would recommend people to just apply this patch to Scheduler if it is needed.

pfrenssen’s picture

Status: Needs review » Closed (won't fix)

Closing this as Won't Fix because it wouldn't benefit the majority of users and will negatively impact people that rely on correct logs to be output on the command line (like during cron runs) . You are of course free to apply this patch if your specific situation requires it.