Closed (fixed)
Project:
Content Construction Kit (CCK)
Version:
5.x-1.5
Component:
General
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Jul 2007 at 21:51 UTC
Updated:
31 Jul 2007 at 22:16 UTC
when submitting the 'content_copy_import_form' with drupal_execute(). The following at the end of content_copy_form_submit breaks things because it explicitly calls drupal_goto()
if (!form_get_errors()) {
if (sizeof($imported_fields) > 0 || sizeof($imported_groups) > 0) {
drupal_goto('admin/content/types/'. $content_info['content types'][$type_name]['url_str'] .'/fields');
}
else {
drupal_goto('admin/content/types');
}
}
The fix is to change the drupal_goto calls to returns, like so:
if (!form_get_errors()) {
if (sizeof($imported_fields) > 0 || sizeof($imported_groups) > 0) {
return 'admin/content/types/'. $content_info['content types'][$type_name]['url_str'] .'/fields';
}
else {
return 'admin/content/types';
}
}
this allows multiple drupal_execute('content_copy_import_form', $form_values) to be placed into one function and program flow will execute correctly. I am using this to create multiple cck types during a _profile_final() call.
I can whip up a patch file if needed, but its a simple change.
-Steve
Comments
Comment #1
yched commentedYep, this has been reported many times, and I finally took the 30 secs to actually commit the fix...
Comment #2
(not verified) commented