[development] converting a module from Drupal 5 to Drupal 6

Michael Prasuhn mike at mikeyp.net
Wed Jan 21 10:09:40 UTC 2009


On Jan 21, 2009, at 1:11 AM, Stewart Robinson wrote:
> Hi,
>
> Op means different things in different places, or at least its  
> values do.
>
> What function does your copied code come from and do you know the  
> value of op?


'op' doesn't mean anything with forms in Drupal 6.

 From http://drupal.org/update/modules/ I was able to find this page: http://drupal.org/node/144132 
  which is titled Drupal 5.x to 6.x form changes.

Here are a few excerpts from that page:

> $form_state['clicked_button']
> A full copy of the button element that was clicked to submit the  
> form. This is more reliable than the old $form_values['op'] name,  
> and also carries any additional information that was placed in the  
> button element's form definition.

and

> The 'op' element in the form values is deprecated and should not be  
> relied upon
> As discussed above, each button can have #validate and #submit  
> functions associated with it. Thus, there should be one button that  
> submits the form and which invokes the normal $form_id_validate and  
> $form_id_submit handlers. Any additional buttons which need to  
> invoke different validate or submit functionality should have button- 
> specific functions. Note also that the 'op' element in the form  
> values, corresponding to the button clicked when there are several  
> in a form in Drupal 5.x, should no longer be relied upon and may not  
> be present.
>


-Mike

__________________
Michael Prasuhn
mike at mikeyp.net
http://mikeyp.net






More information about the development mailing list