webforms in panels
Has anyone else tried to use webforms in a panel? Generally everything is working ok, except for some usability issues.
- if there is an error in the webform validation (missing mandatory fields, invalid email format, etc.), the page redirects to the webform node page with the error messages, and not to the original panel page (specifying internal:panel-page-url seems to work only for successful submissions)
- I specify internal:panel-page-url and after a successful submission, redirects to the panel page, but there is no "success message" displayed, so the user has no clue whether or not the submission was successful.
anyone has any thoughts or alternative implementations?
Groups:
Login to post comments

sounds like a bug in webform.
sounds like a bug in webform. Try searching for an existing one here:
http://drupal.org/project/issues/search/webform
If not submit a new bug
--
Dave Hansen-Lange
Web Developer
Advomatic LLC
East Asia Office
Hong Kong
Temporary fix for this
Not sure if this is still a problem for you but I just ran across the same problem and put up the following quick fix. This has only been test on drupal 6.14 and panels 2. It needs to go into a module to work and was inspired webform_block.
<?php
/**
* Implementation of hook_form_alter(&$form, $form_state, $form_id)
*
* Catch forms that live on a panel to redirect their action back to the same panel.
*/
function bluerinse_form_alter(&$form, $form_state, $form_id)
{
// Get the menu object for the current page.
$menuItem = menu_get_item();
// If the callback method is the panel / pages module, do a bit of extra processing.
if ($menuItem[page_callback] == 'page_manager_page_execute') {
// Loop through the elements of the panel page to see if one them is the current form.
foreach ($menuItem['page_arguments'] as $item) {
$nid = $form['details']['nid']['#value'];
// Only deal with elements which are nodes...
if (gettype($item) == 'object' && get_class($item) == 'ctools_context') {
// If we've found one, update it's action to point back to the same panel page.
if ( $item->data->nid == $nid) {
form_clean_id(null, true);
$form['#action'] = url(drupal_get_path_alias($_GET['q']));
}
}
}
}
}
?>