From 686dc4769827d57b9f1518148239db5a744d19f2 Mon Sep 17 00:00:00 2001 From: adhisimon <adhisimon@gmail.com> Date: Tue, 16 Sep 2014 17:17:25 +0700 Subject: [PATCH] status simpan --- sinkronisasi.include.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sinkronisasi.include.php b/sinkronisasi.include.php index a90f788..c7cedaa 100644 --- a/sinkronisasi.include.php +++ b/sinkronisasi.include.php @@ -150,7 +150,12 @@ function sinkronisasi_import_iterate_insert($terms) { $term = sinkronisasi_set_field_original_tid($term); unset($term->tid); - taxonomy_term_save($term); + + $status_code = taxonomy_term_save($term); + if ($status_code != SAVED_NEW) { + drush_die("Ada kesalahan saat menyimpan data baru."); + } + echo "ORIGINAL: $tid LOCAL: " . $term->tid . " inserted.\n"; } @@ -170,6 +175,11 @@ function sinkronisasi_import_iterate_update($terms) { $term = sinkronisasi_pair_with_parent($term); taxonomy_term_save($term); + $status_code = taxonomy_term_save($term); + if ($status_code != SAVED_UPDATED) { + drush_die("Ada kesalahan saat mengupdate data."); + } + echo "ORIGINAL: $tid LOCAL: " . $term->tid . " updated.\n"; } -- 1.9.0