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

Sheryl (Permutations Software) sheryl at permutations.com
Wed Jan 21 21:38:51 UTC 2009

But (on investigation) it's still the totally wrong function for the job.
The code belongs where it is. I just need to update the syntax. 

-----Original Message-----
From: Sheryl (Permutations Software) [mailto:sheryl at permutations.com] 
Sent: Wednesday, January 21, 2009 4:29 PM
To: 'development at drupal.org'
Subject: RE: [development] converting a module from Drupal 5 to Drupal 6

Apparently the function Matt was talking about is not hook_validate, but
_form_validate. That still doesn't have exactly the parameters he showed,
but $form_state is one of them.


-----Original Message-----
From: development-bounces at drupal.org [mailto:development-bounces at drupal.org]
On Behalf Of Sheryl (Permutations Software)
Sent: Wednesday, January 21, 2009 2:56 PM
To: development at drupal.org
Subject: Re: [development] converting a module from Drupal 5 to Drupal 6

Matt Chapman wrote:
I might suggest moving this code into a hook_validate and hook_submit as 
a possible approach, eg:

function your_form_name_validate($form, $form_state) {
  //This assumes that there is a submit buttons called 'submit'. Adapt 
as per your form.
  if (!_phpfreechat_check_install()) {
    form_set_error('submit', _phpfreechat_not_found());
  if (!_phpfreechat_check_files()) {
    form_set_error('submit', t('Unable to create data folders for 


function your_form_name_submit($form, $form_state) {

What you have here doesn't jive with what I'm seeing in the docs, so I'm
confused. According to the links below, hook_validate does not take
$form_state as a parameter:


Also, you say to name the function "myformname_validate", but I don't see a
form name set anywhere. Where do I get the form name?


	- Sheryl

More information about the development mailing list