Showing posts with label menu. Show all posts
Showing posts with label menu. Show all posts

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.
.

Writing drupal Module - Menu

Today i managed to make an uninterrupted time solely to write another drupal module. This is specifically to create a link at the menu region on the LHS of the site.
However, since there are still errors that require me to debug; i still do not where and what it is, so i just upload the so-called first part of the videolog writing a menu module. This is quite long video with 10min duration.



the following is the error produced from the module that i wrote: