Jump to content

Recommended Posts

Posted

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.

Posted

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;

Posted

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.

  • Like 4
Posted

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.

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
  • Recently Browsing   0 members

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