Closed (outdated)
Project:
Dialog
Version:
6.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 May 2011 at 09:14 UTC
Updated:
6 Jan 2017 at 20:21 UTC
Jump to comment: Most recent
currently it is not possible to pass options directly to the dialog when using dialog_form_wrapper. As you dont know wheather you get an 1 or 2 element-array(js settings), its rather bad to set them later using
$output[0]['options'] = ....
Thats the current code
/**
* Render a form into an AJAX display.
*/
function dialog_form_render($form_state, $output) {
$title = empty($form_state['title']) ? '' : $form_state['title'];
// If there are messages for the form, render them.
if ($messages = theme('status_messages')) {
$output = $messages . $output;
}
$commands = array();
if (isset($form_state['js settings'])) {
$commands[] = ctools_ajax_command_settings($form_state['js settings']);
}
$commands[] = dialog_command_display($title, $output);
return $commands;
}
Just pass $form_state['dialog options'], as dialog_command_display already has the needed signature.
/**
* Render a form into an AJAX display.
*/
function dialog_form_render($form_state, $output) {
$title = empty($form_state['title']) ? '' : $form_state['title'];
// If there are messages for the form, render them.
if ($messages = theme('status_messages')) {
$output = $messages . $output;
}
$commands = array();
if (isset($form_state['js settings'])) {
$commands[] = ctools_ajax_command_settings($form_state['js settings']);
}
$commands[] = dialog_command_display($title, $output, $form_state['dialog options']);
return $commands;
}
Marking as minor API bug, as there are no working "workarrounds".
Comments
Comment #1
devin carlson commentedDialog 6.x is no longer supported.