diff --git l10n_client.module l10n_client.module index 9cd47ad..9fb9488 100644 --- l10n_client.module +++ l10n_client.module @@ -498,13 +498,15 @@ function l10n_client_import_package_form_submit($form, &$form_state) { $query->condition('textgroup', $textgroups); $lids = $query->execute()->fetchCol('lid'); - db_delete('locales_target') - ->condition('language', $langcodes) - ->condition('lid', $lids) - ->execute(); - - // Also remove all source strings without translations. - db_query("DELETE FROM {locales_source} WHERE lid NOT IN (SELECT lid FROM {locales_target})"); + if (!empty($textgroups)) { + db_delete('locales_target') + ->condition('language', $langcodes) + ->condition('lid', $lids) + ->execute(); + + // Also remove all source strings without translations. + db_query("DELETE FROM {locales_source} WHERE lid NOT IN (SELECT lid FROM {locales_target})"); + } } // Set up and start batch for new imports.