I am using v4.7B6 and filter.module filter.module,v 1.113 2006/03/14 15:15:46 unconed Exp $.

This error occurs:

Missing argument 2 for filter_form_validate() in /mnt/am2/08/231/00000012/htdocs/soccer-wikki.info/modules/filter.module in Zeile 833.

I already included the patch and the function now looks

function filter_form_validate($form_id, &$form) {
   foreach (element_children($form) as $key) {
     if ($form[$key]['#value'] == $form[$key]['#return_value']) {
       return;
    }
  }
  form_error($form, t('An illegal choice has been detected. Please contact the site administrator.'));
  watchdog('form', t('Illegal choice %choice in %name element.', array('%choice' => theme('placeholder', check_plain($v)), '%name' => theme('placeholder', empty($form['#title']) ? $form['#parents'][0] : $form['#title'])), WATCHDOG_ERROR));
}

I saw lots of posts somewhere similar to my problem, but neither fixed it or gave me an indication what to do.

By the way .. I am using PHP 5.

Comments

RaRi’s picture

I need a fix on this .. any ideas anybody?

matthew-at-barnson.org’s picture

I know this is an old thread, but it's the top hit in Google for this problem. The "easy" solution that stops the error is to add a default value for &$form:

Change this:
function filter_form_validate($form_id, &$form) {

to this:

function filter_form_validate($form_id, &$form = 1) {

If the argument to the function isn't given by the calling routine, instead of giving an error it just provides a default value of '1'. Not sure of the security concerns of providing such a default value, but it stops your error logs from exploding.