Bugs with hook_send $op='node'

aaron - August 13, 2007 - 18:36
Project:Send
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:dww
Status:needs review
Description

trying the following:

<?php
function pw_send_send($op, $module = 'send', $nodetype='', $node=null) {
  switch (
$op) {
    case
'node':
      return
$node->title;
  }
}
?>

has no effect. i would expect it would allow me to return the text i want displayed, rather than the node body.

i also tried to follow the code in the module, and tried:

<?php
function pw_send_send($op, $module = 'send', $nodetype='', $node=null) {
  switch (
$op) {
    case
'node':
     
pw_send_title($node->title, true);
      return
'pw_send_title';
      break;
  }
}

function
pw_send_title($title = '', $set_title = false) {
  static
$pw_title;
  if (
$set_title) {
   
$pw_title = $title;
  }
  return
$pw_title;
}
?>

which also had no effect.

#1

dww - May 13, 2008 - 06:52
Title:hook_send $op='node' does nothing» Bugs with hook_send $op='node'
Category:support request» bug report
Assigned to:Anonymous» dww
Status:active» needs review

Whoops, I just found this older issue about something I recently debugged and provided patches for:
#257208: hook_send('node') invoked with wrong arguments, callback returned doesn't get info it needs
Just marked that duplicated, but read there for an explanation of the bug and patches that fix it.

 
 

Drupal is a registered trademark of Dries Buytaert.