Skip to content
Snippets Groups Projects
Commit 4172fd80 authored by Sam Boyer's avatar Sam Boyer
Browse files

Do not require a real operation to be registered at a trail in order to

redirect to it.

This is important for cases where the new trail was created as part of
the form submission, and the trail will become available on the
passthrough resulting from the redirect.
parent f1e97c8d
No related branches found
No related tags found
No related merge requests found
...@@ -1434,10 +1434,15 @@ class ctools_export_ui { ...@@ -1434,10 +1434,15 @@ class ctools_export_ui {
// If a new trail is set and we're not ajaxing, set a redirect in the // If a new trail is set and we're not ajaxing, set a redirect in the
// form state so that the form will properly handle the next step. // form state so that the form will properly handle the next step.
if (isset($form_state['new trail']) && empty($form_state['ajax'])) { if (isset($form_state['new trail']) && empty($form_state['ajax'])) {
// Use an explicitly set path for the trail, if one exists.
$operation = drupal_array_get_nested_value($form_state['operations'], $form_state['new trail']); $operation = drupal_array_get_nested_value($form_state['operations'], $form_state['new trail']);
if (!empty($operation['#path'])) { if (!empty($operation['#path'])) {
$form_state['redirect'] = $operation['#path']; $form_state['redirect'] = $operation['#path'];
} }
// Otherwise just derive the default path for the trail and hope it works.
else {
$form_state['redirect'] = ctools_export_ui_plugin_menu_path($this->plugin, 'edit', $item->{$export_key}) . '/' . implode('/', $form_state['new trail']);
}
} }
$this->edit_cache_set($item, $form_state['op']); $this->edit_cache_set($item, $form_state['op']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment