Closed (fixed)
Project:
Scheduler
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Nov 2016 at 14:55 UTC
Updated:
11 Jun 2020 at 12:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jonathan1055 commentedThanks for raising this. The fragment of code in question is:
In between the two lines you mention, we are allowing Rules to react, and then invoking our own PUBLISH event. Maybe one save might be enough - but not sure exactly where it should be. 3rd-party code which reacts to the Scheduler event can modify the $node object (I think) and that is the reason for the final save. Do you think it would work if the
node_publish_actionwas not done before the Rules calls?Comment #3
gaele commentedYes that's what I would prefer, just replace the node_publish_action with $node->setPublished(NODE_PUBLISHED);
It seems to work fine. But I don't use Rules.
Comment #4
aoturoa commentedThis patch applies to drupal/scheduler:8.x-1.0
Comment #5
kishor_kolekar commentedThis patch applies to drupal/scheduler:8.x-1.1
Comment #6
kishor_kolekar commentedComment #7
kishor_kolekar commentedComment #8
kishor_kolekar commentedComment #9
kishor_kolekar commentedComment #10
kishor_kolekar commentedComment #11
kishor_kolekar commentedRerolling the patch from #4 against 8.x-1.x-dev branch.
Please review
Thanks
Comment #13
kishor_kolekar commentedRerolling the patch from #4 against 8.x-1.x-dev branch.
Comment #14
hash6 commentedI have applied the patch and https://www.drupal.org/files/issues/2019-10-11/node_save_twice-2824038-1... and it fixes the issue of "node saved twice".
Comment #15
gaele commentedComment #16
hash6 commentedComment #17
jonathan1055 commentedI did not like the idea of abandoning the standard actions system for publishing and unpublishing the nodes. So I've made a small change to re-use that method at the end, instead of the plain
->save(). See the interdiff file. I would like to know how to test the Actions system, to make sure we are doing the right thing here. I know that the current tests all pass, but I am not certain that this is actually covered in our tests. If anyone can help, please do, as I want to get this committed. Thanks.Comment #19
jonathan1055 commentedNo further input since 8th Nov. Decided to commit this as I want to release Scheduler 8.x-1.2