Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If there are no groups defined for the content type you want to copy you'll get the following warning:
warning: Invalid argument supplied for foreach() in
*/sites/all/modules/cck/modules/content_copy/content_copy.module on line 193.
because of argument
$form_values['groups']
is a:0:{} is no array
wrapping the loop with
if(is_array($form_values['groups'])){
foreach ($form_values['groups'] as $group) {
$group_state = array('values' => array('group_name' => $group));
drupal_execute('fieldgroup_edit_group_form', $group_state, $content_type, $group, 'edit');
}
}
did it.
best,
tarik
Comments
Comment #1
tascbut with this quick fix,
you have to highlight and export the groups as well !!
hm...
Comment #2
yched CreditAttribution: yched commentedfile under the new 'content_copy.module' component
Comment #3
KarenS CreditAttribution: KarenS commentedI get no such error in the current code when exporting and importing a type with no groups, so I assume that yched's recent work-over of Content Copy has fixed things.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.