Validation error, please try again. If this error persists, please contact the site administrator.

This happens when submitting comment form (probably any form) that is displayed on panel inside panel.

First I tried Panels teasers module. In node view page I added Views pane that displays node teasers and node teasers were styled by Panels teasers module and included some node stuff + comment form. Comment form returned error. Opened issue here #957766: form validation errors for forms on teaser.

Then I tried other approach with new awesome module http://drupal.org/project/bc_panel_bonus and it also suffered from same problem. Opened issue here #957884: Form validation error.

By then I realized that problem must be somewhere else or here and its something to do with form tokens. What could be wrong?

Comments

mansspams’s picture

Finally I found a elegant workaround. In hook_form_alter set $form_state['rebuild'] = TRUE; like this...

function MODULENAME_form_alter(&$form, $form_state, $form_id) {
  switch ($form_id) {
    case 'comment_form':
      $form_state['rebuild'] = TRUE;
    break;
  }
}

Issue still needs to be fixed IMO. Now I'm not sure if its Ctools issue.

jemond’s picture

+1,000,000 points

This patch fixed my issue. Was totally stumped on this. I owe you a beer at Denver ;) Thanks!

Posted the issue at SE before I found the resolution here:
http://drupal.stackexchange.com/questions/19993/validation-error-every-t...

andreigg’s picture

Even if it's not elegant, you can also unset the form #token to pass the validation - in my case, for a search form, the validation is not needed:

<?php
function MODULENAME_form_alter(&$form, $form_state, $form_id) {
  switch ($form_id) {
    case 'search_block_form':
      unset($form['#token']);
    break;
  }
}
?>
joelpittet’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Triaging the 6.x issues, it's no longer supported.