Thanks for the great module
With execute arbitrary php script I want to copy the date value into another date field within the same content type
field_date2013 = new field (with collect end date enabled)
field_date2013start = old field
$object->field_date2013[0]['value'] = $object->field_date2013start[0]['value'] ;
node_save($object);
I get this error;
An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /www.drupal.com/dicknorman/batch?id=9&op=do StatusText: Service unavailable (with message) ResponseText: EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7633 of D:\www.drupal.com\dicknorman\includes\common.inc).
What am I doing wrong?
Comments
Comment #1
bojanz commentedThere's no $object. It's $entity.
Try with that.
Comment #2
bojanz commentedComment #3
SharonD214@aol.com commentedI'm having the same issue here. Using the following:
$entity->field_journal_expiration_date[0]['value'] = $entity->field_date_expiration[0]['value'] ;
node_save($entity);
An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?id=773&op=do StatusText: Service unavailable (with message) ResponseText: EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7697 of \Sites\drupal\includes\common.inc).
Any help would be great!
Thanks
Sharon
Comment #4
jesss commentedIn case anybody else stumbles onto this looking for the solution, here's the correct code:
Comment #5
leisurman commentedI can copy one custom date field to another custom date field using this code and it works:
But how can I copy a custom date field to the drupal post date/created field? When the two formats are different?
I tried this code but the post date comes out wrong with a date of 1969, I am using this code
Comment #6
jesss commented@leisurman -- I think you just need to do an extra bit of processing to convert the data from the date field from ISO to a timestamp. I haven't tested it, but something like this should work.
Comment #7
leisurman commentedThank you Jess you are right. I did not test your code but I found that Feeds tamper module can add the code to the date before its processed, its called "String to timestamp" It did the trick.