Frank Vèssia Posted July 29, 2013 Share Posted July 29, 2013 Hello, i'm in the process of migrating and old Drupal website into PW. I'm pretty done but my only problem is the "created" field. I would like to edit this filed during the import to match the old existing date content. It's possible? I've tried with $article->created=$oldDate but i guess this field it's read only. I know i can create another custom field and using this one but could be nice using the default one. Link to comment Share on other sites More sharing options...
Wanze Posted July 29, 2013 Share Posted July 29, 2013 Did you try create the page first and then set the date (save the page again after it exists). At least it's possible to set the created property on the page object, so I think the save should work too: Edit: See teppos post below, it's not that easy // In Page.php case 'created': case 'modified': if(!ctype_digit("$value")) $value = strtotime($value); $this->settings[$key] = (int) $value; break; Link to comment Share on other sites More sharing options...
teppo Posted July 29, 2013 Share Posted July 29, 2013 Unless something has changed since then, it would appear that this can't be changed that easily. See this thread for a possible solution and Ryan's explanation. 4 Link to comment Share on other sites More sharing options...
Frank Vèssia Posted July 29, 2013 Author Share Posted July 29, 2013 Thanks guys, even it's not the best practice I'll do it via sql, i'll do just one time for the import, it's a waste of resources creating another field, especially after the import the new articles will use default field for the date. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now