Hi gurus and fellows,
I have to generate an application form, that needs to be displayed both a as "page" (hook_menu) and as "block".
I factorized the form generation within the same function (generate_form). It works fine, except for the validation process. Clearly the validation happens (form is not submitted when it fails), but the form_set_error() is never displayed in block mode (in page mode, it works fine).
This "lack of display" also happens for regular validation ('#required'=>'true'), so I don't think my custom validation code is at stake :
When in page mode, the required fields get highlighted, the error message is displayed.
When in block mode, the required fields get highlighted (red-bordered), BUT the error message is NOT displayed.
Of course, I checked that the page.tpl.php, used to display the block, has a 'message' section, within it. Proof is my drupal_set_message() gets displayed on submit.
Oddly enough, when I put a drupal_set_message() within my custom validation function, it gets displayed, as long as (and only when) the validation passes ! Wierd...
I pasted the *.module code here : http://pastebin.com/cnwzp3UU
Any idea ?