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

Steven Jones darthsteven at gmail.com
Wed Jan 21 16:48:46 UTC 2009


$form_values['op'] is the '#value' of the clicked button on a form, so
I'd guess if it were empty, then then the form hasn't been submitted
yet.

Regards
Steven Jones
ComputerMinds ltd - Perfect Drupal Websites

Phone : 0121 288 0434
Mobile : 07951 270 026
http://www.computerminds.co.uk



2009/1/21 Sheryl (Permutations Software) <sheryl at permutations.com>:
> Please - I don't need links or excerpts from the linked pages. I've read the
> docs. I can't see how to apply what is written to this module code.
>
> Is there anyone here who can add something to what is already in the docs -
> fill in the missing piece for me?
>
> Thank you.
>
>
> -----Original Message-----
> From: development-bounces at drupal.org [mailto:development-bounces at drupal.org]
> On Behalf Of Michael Prasuhn
> Sent: Wednesday, January 21, 2009 5:10 AM
> To: development at drupal.org
> Subject: Re: [development] converting a module from Drupal 5 to Drupal 6
>
> 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