function drupalGetNodeByTitle($title) {
    $nodes = node_load_multiple(array(), array('title' => $title));

which, naturally, doesn't exist in Drupal 6. Small switch to node_load() would be the fix.

Comments

boombatower’s picture

Assigned: Unassigned » boombatower
Status: Active » Needs review
StatusFileSize
new1.05 KB

Please confirm this fixes the problem for you.

morbus iff’s picture

Status: Needs review » Reviewed & tested by the community

Yep, that's exactly the change I'm using locally.

boombatower’s picture

Status: Reviewed & tested by the community » Fixed

Committed to DRUPAL-6--2.

Status: Fixed » Closed (fixed)

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

hass’s picture

Title: drupalGetNodeByTitle uses node_load_multiple in 6.x » drupalGetNodeByTitle doesn't return node object
Priority: Normal » Critical
Status: Closed (fixed) » Active

Test robot on d.o is broken. See http://drupal.org/node/903318.

I figured out that drupalGetNodeByTitle() seems not loading the node object! It only returns "1". Example code below:

// Fill node array.
$edit = array();
$edit['title'] = $this->randomName(32);
$edit['body'] = $this->randomName(100);
$edit['path'] = $this->randomName(10) . '/' . $this->randomName();
$edit['format'] = 2;

// Save node.
$this->drupalPost('node/add/page', $edit, t('Save'));
$this->assertRaw(t('@type %title has been created.', array('@type' => 'Page', '%title' => $edit['title'])), t('Node was created.'));

// BUG
$node = $this->drupalGetNodeByTitle($edit['title']);

// Node object expected, but value is only "1".
$this->verbose($node);
boombatower’s picture

Status: Active » Closed (duplicate)