Monday, April 2, 2012

Trouble shoot drupal menu module - successful

There is something not that clear about the explanation on using the function hook_menu() and its associative array keyname as in the drupal doc site. There is one particular passing variable that i do not understand how it's used and how does it pass values to other created custom function namely current_posts_form(). The key function used here is drupal_get_form(), it is only used once in the hook_menu() but does not have its own function declared in my codes.

Below is videolog that shows how i managed to point out the error i made. Anyway, frankly speaking it is actually not a programmatical errors but it is simply because of the function callback declared inside the associative array that is not declared inside my codes. So, whenever drupal core program searches for the callback function and it cannot find one, that's when it produces such error.



in a nutshell what i did to rectify the error was; i create an empty function content_posts_form() so that drupal core program can pick it up although it does nothing, so when reset the module (deactivate & reactivate) the content shows no error but with empty content body.
.

No comments:

Post a Comment