This is a follow-up issue for #2776665: Support for multi-lingual translations and differing scheduled dates
When scheduled publishing and unpublishing dates are set to be translatable and independent on each translation then this all works fine. However, there is a slight problem when the publish-on date is set to be not translatable - where a scheduled publish-on date entered on one translation is copied to all other translations. This works OK, but our automatic unpublishing of a scheduled node, which is done in hook_node_presave() is only executed for the translation being saved. The status of the other translations is not changed. Hence we can get the situation where a new translation is scheduled to be published, the date is set on the original translation automatically, but it remains published. This could be said to be an admin/setup problem. If you want every translation publish-on date to be synchronised then you should also set the node status to be synchronised too. That solves the problem completely.
A possible solution is to give a message if the dates are synchronised but status is not set to be synchronised. I do not think we should force both settings to match. Adding code to hook_node_presave() to change the status could be done, but that may be over-complex.
Comment | File | Size | Author |
---|---|---|---|
#5 | 2871164-5.translatable-fields.patch | 18.76 KB | jonathan1055 |
| |||
#4 | analysis of translatable field settings.pdf | 28.68 KB | jonathan1055 |
Comments
Comment #2
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedFinally got round to working on this. Here is an updated Multilingual test, which will fail without the .module changes
Comment #4
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedI decided rather than just give a warning if the publish_on date is synchronized but status is translatable, the problem was bigger than this. It involves unpublish_on too, and after a lot of analysis, it became clear that all three fields should either be all translatable (so can vary from translation to translation) or they should all be synchronized over all translations. So this led to adding a validation handler to prevent the form being saved if any of the three fields had a diferent setting to the other two. I have uploaded my notes for the record.
Comment #5
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedPatch with changed to .module for validation, and the updated test.
Comment #7
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedFixed.