Community Documentation

Converting 3.0.x modules to 4.0.x

Last updated February 20, 2008. Created by kika on May 13, 2003.
Edited by webchick, puregin. Log in to edit this page.

Converting modules from version 3.0 to version 4.0 standards requires rewriting the form() function, as follows:

Drupal 3.0:

function form($action, <b>$form</b>, $method = "post", $options = 0)

// Example

global $REQUEST_URI;
$form = form_hidden("nid", $nid);
print form($REQUEST_URI, $form);

Drupal 4.0:

function form(<b>$form</b>, $method = "post", $action = 0, $options = 0)

// Example

$form = form_hidden("nid", $nid);
print form($form);

Archive

Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.
nobody click here