• node_submit function requires an object: $node = node_submit((object)$form_state['values']);
  • node_teaser function is not defined, use text_summary($node->body, $node->format);
  • drupal_clone function is not defined, use clone($node);
  • theme function requires an array, $output = theme('node_preview', array('node' => $cloned_node));

That's what I've found so far, unfortunately it's not working yet.

Comments

tito.brasolin’s picture

  • node does not get default attributes, this can be fixed with adding node_object_prepare(): $form_state['node'] = node_object_prepare($node);
  • using a .load() function with an array as argument is not supported anymore, the load_multiple() functions need to be used: i.e. $users = user_load_multiple(array(), array('name' => $node->name));

I completely removed the teaser extraction part, my preview is working now! :)

maurizio.ganovelli’s picture

Assigned: Unassigned » maurizio.ganovelli
Status: Active » Fixed

The last commit to the repository should have solved this problem: the paypernode_node_form_preview function now follows closely node_form_build_preview used by node.module to build node preview.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.