Closed (outdated)
Project:
Internationalization
Version:
6.x-1.x-dev
Component:
Synchronization
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
6 Feb 2010 at 12:43 UTC
Updated:
8 Sep 2017 at 10:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Stefano commentedI was looking just in this feature, as I have the same problem of having the same sorting order.
I did the code change as suggested here but this doesn't seem to work.
When I create a new translation for a node the 'created' date of the Sourcee isn't loaded in the "authored on" field.
I have tried to follow the code of the module but I'm not experienced in Drupal codes so I can't understand why this doesn't work.
If anyone can help I'd really appreciate.
Thank you in advance.
Comment #2
Anonymous (not verified) commentedHave you also ticked the checkbox at the content type's multilingual settings? You need to select "changed" or "published" (whichever one it is). Then it should work.
Comment #3
Stefano commentedYes I have. Or better, I have checked the "Post Date" checkbox, it's the one that was added applying the patch above.
I have tested a bit with what's happening in the module. If I have understood right how that works the function responsible for loading the right value upon creation of the translation is 'i18nsync_prepare_translation'. I have echoed some values in the function and it seems that it behaves correctly, it copies the "created" value (the timestamp) from the source to the new node, but somehow it doesn't get set in the HTML. On the contrary it's the Source's "created" date that gets modified to the current date. Maybe Drupal forces the "created" form field to be empty when a node is created.
If I change the "created" value of one node it gets correctly changed on the other nodes too, so this works ok; it's just the creation process that doesn't work.
Please, if you can find a solution to this tell me. It's the last thing I need to complete the new version of my website ^^
Comment #4
Stefano commentedAfter some time spent tring to understand where Drupal was ignoring the 'created' field I've found how to make this feature work correctly.
The solution came while reading the how the node_form function works. This is the function that defines those form fields and look at the point where it defines the 'created' field it is clear that a default_value for that field is not defined if $node->date is not set so the only thing do to was setting this variable (with a formatted date, not with the timestamp).
I'm sorry if I don't create a patch....but I have no idea how to make one XD
What is required to make this all work is a little add to the function i18nsync_prepare_translation (in addition to the patch posted above, of course):
Comment #5
rup3rt commented+1 For this -- essential for any content that is date dependent
Comment #6
jose reyero commentedNo working patch that I can see.
Comment #7
lmeurs commentedUnfortunately I also do not have a patch (I'm still learning!), but hopefully this will help for v7.x-1.1 (latest) of i18n/i18n_sync/i18n_sync.modules.inc. Also see attachment (which has a .txt extention for uploading reasons).
On line 58 we only added the 'created' element.
Comment #8
lmeurs commented(I accidentally changed the thread's title and had to post another comment to revert the change)
Comment #9
tunicPatch attachted. Tested on 1.0 (I'm sorry, I'm stuck at this version for some reasons at the moment) but patched ported to 7.x-1.x (code has not changed, at least the one that sourrounds what I've changed).
Patch is based on previous notes, but... mmm... line numbers and file names from previous comments do not match with i18n_sync module...
Comment #11
tunicOoops!
Changing version, I hope this is why it fails.
Comment #12
tunic#9: i18n-sync_post_date-706462-9.patch queued for re-testing.
Comment #13
jose reyero commentedCommitted, thanks.
Comment #15
j0rd commentedI need this feature backported to 6.x as well.
Comment #16
j0rd commentedPatch against 6.x-1.x-dev
Comment #18
joseph.olstad