From 1397957af9ab18324b23396f89844072adae568c Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Fri, 23 Nov 2012 10:32:22 +0100 Subject: [PATCH] Fixing delete debug see BT#4882 --- tests/migrate/migration.custom.class.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/migrate/migration.custom.class.php b/tests/migrate/migration.custom.class.php index 574c4f376c..a20cff5cce 100644 --- a/tests/migrate/migration.custom.class.php +++ b/tests/migrate/migration.custom.class.php @@ -1359,16 +1359,17 @@ class MigrationCustom { $info_before = $extra_field_option->get_field_options_by_field($extra_field_info['id']); $deleting_option_ids = array(); - foreach($extra_field_option_info as $option) { + foreach ($extra_field_option_info as $option) { //@todo Delete all horario in sessions? $result = $extra_field_option->delete($option['id']); - $deleting_option_ids[] = $option['id']; - } - $deleting_option_ids = implode(',', $deleting_option_ids); - + if ($result) { + $deleting_option_ids[] = $option['id']; + } + } $info_after = $extra_field_option->get_field_options_by_field($extra_field_info['id']); - if ($result) { + if (!empty($deleting_option_ids)) { + $deleting_option_ids = implode(',', $deleting_option_ids); return array( 'entity' => $extra_field_variable, 'before' => $info_before, @@ -1378,7 +1379,7 @@ class MigrationCustom { ); } else { return array( - 'message' => "Extra field option was NOT deleted - extra field not found field_variable: $extra_field_variable", + 'message' => "Extra field option was NOT deleted - no field options ids where found for variable: $extra_field_variable", 'status_id' => self::TRANSACTION_STATUS_FAILED ); }