From 96bb867fb9875e3239c960fe419715e08c47acf2 Mon Sep 17 00:00:00 2001 From: chalbertgit Date: Mon, 12 Nov 2012 16:48:16 -0500 Subject: [PATCH] [#1563] Corrected an introduced bug when a tag is created and reworked so that the extract function recreates tags for when iptc data is rescanned. --- 3.0/modules/iptc/helpers/iptc.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/3.0/modules/iptc/helpers/iptc.php b/3.0/modules/iptc/helpers/iptc.php index 7c018006..143b1039 100644 --- a/3.0/modules/iptc/helpers/iptc.php +++ b/3.0/modules/iptc/helpers/iptc.php @@ -71,17 +71,18 @@ class iptc_Core { $record->key_count = count($keys); $record->dirty = 0; $record->save(); - if (!empty($iptc['Keywords']) { - $tags = explode(';', $iptc['Keywords']); - foreach ($tags as $tag) { - try { - tag::add($item, $tag); - } catch (Exception $e) { - Kohana_Log::add("error", "Error adding tag: $tag\n" - . $e->getMessage() . "\n" - . $e->getTraceAsString(); - } - } + + if ( array_key_exists('Keywords', $keys) ) { + $tags = explode(';', $keys['Keywords']); + foreach ($tags as $tag) { + try { + tag::add($item, $tag); + } catch (Exception $e) { + Kohana_Log::add("error", "Error adding tag: $tag\n" + . $e->getMessage() . "\n" + . $e->getTraceAsString()); + } + } } }