Jump to content

edit created field during import


Frank Vèssia
 Share

Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...