Hi!

I use drupal_execute() to add multiple instances of a node type. Since they have the same form_id, the static $validated_forms array of drupal_validate_form() will cause every validation to be skipped except the first. I do not see any workaround I could use except to modify form.inc.

Could you provide a way to allow multiple submits of the same form, or propose a workaround?

Thanks,

Zoltan

Comments

bdragon’s picture

Version: 5.1 » 5.x-dev

I just ran into this myself... Bumping.

budda’s picture

Dang! I too have discovered this problem, and no fix :-/

The offending return....

function drupal_validate_form($form_id, $form, &$form_state) {
  static $validated_forms = array();

  if (isset($validated_forms[$form_id])) {
    return;
  }
...
darren oh’s picture

Version: 5.x-dev » 6.x-dev

Still here, and now in 7.x.

budda’s picture

Version: 6.x-dev » 7.x-dev

Did somebody say 7.x ? :-)

markus_petrux’s picture

Status: Active » Closed (duplicate)

Marked the following issue as duplicate of this one, which is reported first.

#256573: drupal_validate_form() cannot be used twice on the same form

But then I found this, which has a bit more information and patches:

#260934: Static caching: when drupal_execute()ing multiple forms with same $form_id in a page request, only the first one is validated

TheThumbPuppy’s picture

subscribing

this problem is a major inconvenience

surely when we look at creating nodes programmatically, creating a bunch of nodes of the same node type is very common

if anybody feels like solving this problem on D6 it would be most appreciated :)

jarune’s picture

// remove this