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

Steven Jones darthsteven at gmail.com
Wed Jan 21 17:54:11 UTC 2009


Use form_set_error
(http://api.drupal.org/api/function/form_set_error/6) and call it with
the first parameter as 'NULL', then the error will be set on the form
as a whole, not an individual element.

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>:
> Ah! This helps. Thank you!! So in Drupal 6 I would change this to:
>
>        if ($form_state['submitted'] == false) {}
>
> Correct?
>
> Now I just have that other mystery:
>
>  if (<something wrong with module installation>) {
>    form_set_error('op', _phpfreechat_not_found());
>  }
>
> I'm guessing that this prevents the user from submitting the admin form if
> the module isn't installed correctly. (I need to confirm by causing the
> error and seeing what happens in the admin form.)
>
> In Drupal 6, how do I set a general form error that is not related to a
> particular field? Or maybe the question is... In Drupal 6, how do I set a
> form error tied to the submit button?
>
>
>
> -----Original Message-----
> From: development-bounces at drupal.org [mailto:development-bounces at drupal.org]
> On Behalf Of Steven Jones
> Sent: Wednesday, January 21, 2009 11:49 AM
> To: development at drupal.org
> Subject: Re: [development] converting a module from Drupal 5 to Drupal 6
>
> $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
>
>
>


More information about the development mailing list