Hi all and thanks for the wonderful node_expire
Im developing a site and im using node_expire and i18n.
I noticed that when I have 1 node and some translation, if I change some of this nodes' expiration time, then the others get changed to 1969-12-31
I've been folowing issue on
http://drupal.org/node/644682#comment-3297862
and changed the specified code, so i dont know if this bug comes after this modification or from before. I think this is not related with the last change.
I think this should be solved soon as its very important for many people to use i18n and having a bug with this is not good for module usage.
I was looking on function _node_expire_nodeapi
but i cant figure out how to not make it change.
I clarify that im using "default expiration" date but not "requiered expiration date".
Maybe this could be solved by removing the default date. I will tray and write here later.
It would be nice we could have a checkbox on multilenguage options->synchronize translations on the content types edit form to synchronize expiration date on all translations but im not sure wich module should make the fix.
hope this helps to solve the bug. I´ll continue searching for a solution

serguitus

Comments

serguitus’s picture

Additional information:
I already tried to remove the default expiration date to see if the problem is removed and its not :(
i used information on modules/i18n/i18nsync/readme.txt to try to syncronize 'expire' field on my nodes but It does nothing:( :( :(
Hope someone can help soon. Im checking constantly.

bye

serguitus’s picture

Issue tags: +bug node expire translation

I've noticed that every time when I click "save" on any node edit form, then on the database on node_expire table, the dates(numbers) for 'expire' field turns to 0 on every translations of that node...
PLEASE.... SOMEONE HAS A CLUE!!!???
:(

klonos’s picture

Title: Problems with node expire and i18n translations » Node translation expiration reset on node save/translation sync.

A better title for it and testing to see if I can reproduce this one...

serguitus’s picture

Ok, thanks for your response. Im glad you answered!
Im waiting for your results....
hope you get luck!

serguitus’s picture

OK.... I DID IT!!!!

well, finally!!!.... after a long time seeking between i18n module and node_expire module, I found that on node_expire.nodeapi.inc on line 63

$node->expire = strtotime($node->expire);

this requieres the format to be 'Y-m-d', BUT, in modules/i18n/i18nsync/i18nsync.module, on function i18nsync_node_translation in line 263, there is not special atention to 'expire' field and so, its copied with normal assignment, this means that the date on timestamp format its copied literally to $translation->expire field. so this makes a return of 0 on line 63 of node_expire.nodeapi.inc

so, this is my solution:

I added

case 'expire':
          //to sync expire field it must be on 'Y-m-d' format
          $translation->expire = format_date($node->expire, 'custom', 'Y-m-d');
          break;

on line 330 of i18nsync.module and this sets the correct format (string representation) to the 'expire' field to be correctly processed later on node_expire.nodeapi.inc
I should clarify that I included 'expire' field on the list of sync fields as instructed in modules/i18n/i18nsync/README.txt

so, I finally changed code on i18n module and not on node_expire module. I think it would be nice to advise i18n sponsors to include this on new release but I dont really now exactly how to tell them to read this issue. any help would be appreciated

I think that there could be another solution by changing code on node_expire.nodeapi.inc to allow data passed on datestamp format.

Hope this could help someone to save time.

thanks klonos for your interest
PS. I will let it opened until sponsors fix this. (I think)

you can contact me for further info at
serguitus@gmail.com

vikramy’s picture

Status: Active » Closed (duplicate)
klonos’s picture

vikramy’s picture

klonos’s picture

Thanx for taking the time to reply Vikram;