Index: pathauto.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.module,v retrieving revision 1.169 diff -u -p -r1.169 pathauto.module --- pathauto.module 13 Jan 2011 03:27:24 -0000 1.169 +++ pathauto.module 13 Jan 2011 19:55:02 -0000 @@ -290,6 +290,8 @@ function pathauto_node_presave($node) { * Implements hook_node_insert(). */ function pathauto_node_insert($node) { + // @todo Remove the next line when http://drupal.org/node/1025870 is fixed. + unset($node->uri); pathauto_node_update_alias($node, 'insert'); } Index: pathauto.test =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.test,v retrieving revision 1.38 diff -u -p -r1.38 pathauto.test --- pathauto.test 13 Jan 2011 03:27:24 -0000 1.38 +++ pathauto.test 13 Jan 2011 19:55:02 -0000 @@ -349,16 +349,20 @@ class PathautoFunctionalTestCase extends * Basic functional testing of Pathauto. */ function testNodeEditing() { - // Create node for testing. + // Create node for testing by previewing and saving the node form. $random_title = $this->randomName(10); $title = ' Simpletest title ' . $random_title . ' ['; $automatic_alias = 'content/simpletest-title-' . strtolower($random_title); - $node = $this->drupalCreateNode(array('title' => $title, 'type' => 'page')); + $this->drupalPost('node/add/page', array('title' => $title), 'Preview'); + $this->drupalPost(NULL, array(), 'Save'); + + $node = $this->drupalGetNodeByTitle($title); + $this->assertEqual($this->getUrl(), url($automatic_alias, array('absolute' => TRUE)), 'Generated alias associated with the node.'); // Look for alias generated in the form. $this->drupalGet('node/' . $node->nid . '/edit'); $this->assertFieldChecked('edit-path-pathauto'); - $this->assertFieldByName('path[alias]', $automatic_alias, 'Proper automated alias generated.'); + $this->assertFieldByName('path[alias]', $automatic_alias, 'Generated alias visible in the path alias field.'); // Check whether the alias actually works. $this->drupalGet($automatic_alias);