Use case to test:
1 -> Node with 2 languages
2 -> Both tranlations are published
3 -> Making changes for each tranlsation and put in ready for review state
4 -> Schedule publication and save both
5 -> When cron run only publish the latest saved revision of latest saved translation.
I've tried to remove the unset of the publish_on field, i think the issue there is that this field not have it's own table but this not change anything, i will try to fix by my hand but if some one can help or point me in the right way will be great.
I'm thinking also could be related to the way is keeped latest revision of the node in SchedulerManager.php row 536:
" $node = $node_storage->load($nid);
$revision_ids = $node_storage->revisionIds($node);
$vid = end($revision_ids);
"
Comments
Comment #2
bigbabertComment #3
bigbabertComment #4
bigbabertComment #5
bigbabertBelow my custom module main functions that solve this issue:
Comment #6
bigbabertComment #7
bigbabertComment #8
Raman Starshykh commentedComment #9
jonathan1055 commentedIn between step 4 and 5 above, are both of the translated nodes showing as scheduled on the admin/content/scheduled tab?
Comment #10
bigbabertHi nope in admin/scheduled/tab was only the latest saved translation, the node is only one but with 2 tranlsations.
My suggestion is to get the revision id from the field u create for scheduling and then load Revision by field revision id.
To fix my use case i develop my own module so we can use with composer dependency, if can help have a look:
https://www.drupal.org/project/moderation_scheduler
Regards
Comment #11
rodman1980 commentedComment #12
avpadernoComment #13
idflood commentedThis issue is still present with the latest version of the modules.
I'm still not sure where exactly is the problem but in the node_field_revision table the data looks ok, but it seems that once the first translated version is published the data in node_field_data is changed for both languages. So even if the unpublished version has still the correct information in node_field_revision it doesn't get picked by the query at the beginning of the scheduler/src/SchedulerManager->publish method, and later on it will be discarded by the "publish_on" check which return null.
edit:
- may be related to https://www.drupal.org/project/drupal/issues/3088341
- this post also highlight one issue we have here I think: https://www.drupal.org/project/drupal/issues/2815779#comment-13365758 "what I'm really trying to figure out is why there's a new english revision when I only updated the translation"
- the way the last revision is loaded in scheduler was added here https://www.drupal.org/project/scheduler/issues/3049070
Comment #14
idflood commentedLooks like this issue is being taken care in https://www.drupal.org/project/scheduler/issues/3080979
Comment #15
avpaderno@idflood if the other issue contains a patch that fixes the issue reported here, this issue can be closed as duplicate. May you confirm that the patch in the other issue would eventually fix the issue reported here?
Comment #16
eric_a commentedComment #17
smustgrave commentedCan you try on 2.x branch
Comment #18
smustgrave commentedIf still experiencing this issue with 2.x branch or 3.0.x when I release that soon please reopen.