[documentation] [Documentation bug] Wrong instructions for updating module from 4.7 to 4.8 at hook setting

pwolanin drupal-docs at drupal.org
Tue Aug 29 22:31:21 UTC 2006


Issue status update for 
http://drupal.org/node/81346
Post a follow up: 
http://drupal.org/project/comments/add/81346

 Project:      Documentation
 Version:      <none>
 Component:    Developer Guide
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  Rok Žlender
 Updated by:   pwolanin
-Status:       active
+Status:       fixed

also corrected the call to system_settings_form, which now only takes
$form as an argument.




pwolanin



Previous comments:
------------------------------------------------------------------------

Tue, 29 Aug 2006 17:23:34 +0000 : Rok Žlender

Hi


I noticed that instructions for updating module from 4.7 to 4.8 at
http://drupal.org/node/64279#hook-settings are not correct. The code
that is writtne there  does not work.
Wrong:
<?php
 $items[] = array(
    'path' => 'admin/settings/your-module',
    'title' => t('your ole ola'),
    'callback' => 'yourmodule_admin_settings',
    'access' => user_access('administer site configuration'),
    'type' => MENU_NORMAL_ITEM,
   );
?>
Correct:
<?php
 $items[] = array(
    'path' => 'admin/settings/your-module',
    'title' => t('your ole ola'),
    'callback' => 'drupal_get_form',
    'callback arguments' => array('yourmodule_admin_settings'),
    'access' => user_access('administer site configuration'),
    'type' => MENU_NORMAL_ITEM,
   );
?>


I hope I put it right.




------------------------------------------------------------------------

Tue, 29 Aug 2006 22:15:40 +0000 : pwolanin

For the example code that's given, i think you are correct and I'll
update it.  Obviously, in general, a callback can be any function, not
just drupal_get_form.






More information about the documentation mailing list