[development] starting...

John VanDyk jvandyk at iastate.edu
Wed Oct 31 04:14:59 UTC 2007

Hello, Willians. Welcome to Drupal. The code for the annotation 
module can be downloaded here


in case you want to compare it to the code you are using. The code 
works by retrieving a note from the database and assigning the value 
to the node object. The node is then passed to the form function. It 
looks like you are passing only the annotation property and not the 
entire node. Your code:

...'#value' => drupal_get_form('annotate_entry_form', $node->annotation),

what it should be:

...'#value' => drupal_get_form('annotate_entry_form', $node),

This kind of question is best asked in the drupal.org support forums 
rather than on the development list.



>  Hello, I'm Willians, living in Brazil and do not know English law, 
>then not repair the errors. :D
>  I starting the develop for drupal, know a little of PHP, mysql. I 
>am reading the book Pro Drupal Development, and the example of the 
>book "chapter 2", I am not understanding the code right.
>  More specifically, the function where return the datas. that is 
>annotate_nodeapi(&$node, $op, $teaser, $page), when return the 
>result of the database, this code:       
>          $node->annotation = db_result($result);
>  No is showing, the result in screnn, should be :
>       $node->content['annotation_form'] = array(
>         '#value' => drupal_get_form('annotate_entry_form', $node->annotation),
>         '#weight' => 10
>       );
>  Someone knows where my erros ??
>  Thank you, all... :D
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20071030/8095d1dc/attachment-0001.htm 

More information about the development mailing list