By wmclark on
Inside my luvlyricshelper_nodeapi function I have this:
switch ($op) {
case 'validate':
luvlyricshelper_validate_lyrics();
break;
..more code
then I have:
function luvlyricshelper_validate_lyrics() {
drupal_set_message('here: <pre>'. print_r($node, TRUE) .'</pre>');
drupal_set_message('here: <pre>'. print_r($form_values, TRUE) .'</pre>');
drupal_set_message('node type is '. $node->type);
$type = 'lyrics';
if ($node->type == $type) {
drupal_set_message("node type is lyrics");
... more code
For some reason, the $node object seems to be empty as well as $form_values
I also never get the message "node type is lyrics". What's going on here?
Comments
You need to pass the values to luvlyricshelper_validate_lyrics
PHP variables are by default local to a function so if you want $node and $form_values available to the function change the function call to
and the function declaration to
Hah, Thanks, I earned the
Hah,
Thanks, I earned the noob stamp!
Thank you nevets