From 73f348b29efea0100b24b31f637c77ceca44911c Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 28 May 2009 21:07:47 -0700 Subject: Protect get() against missing records. --- modules/exif/helpers/exif.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/exif') diff --git a/modules/exif/helpers/exif.php b/modules/exif/helpers/exif.php index c488bbd4..970be5ac 100644 --- a/modules/exif/helpers/exif.php +++ b/modules/exif/helpers/exif.php @@ -88,6 +88,10 @@ class exif_Core { $record = ORM::factory("exif_record") ->where("item_id", $item->id) ->find(); + if (!$record->loaded) { + return array(); + } + $definitions = self::_keys(); $keys = unserialize($record->data); foreach ($keys as $key => $value) { -- cgit v1.2.3 From c4c70c537d1d72ad5e476190c069270450fa7048 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 28 May 2009 21:13:49 -0700 Subject: Tweak path slightly --- modules/exif/tests/Exif_Test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/exif') diff --git a/modules/exif/tests/Exif_Test.php b/modules/exif/tests/Exif_Test.php index aa76d036..312ed535 100644 --- a/modules/exif/tests/Exif_Test.php +++ b/modules/exif/tests/Exif_Test.php @@ -22,7 +22,7 @@ class Exif_Test extends Unit_Test_Case { $rand = rand(); $root = ORM::factory("item", 1); $photo = photo::create( - $root, DOCROOT . "modules/exif/tests/data/image.jpg", "$rand.jpg", $rand, $rand); + $root, MODPATH . "exif/tests/data/image.jpg", "$rand.jpg", $rand, $rand); $expected = array( array("caption" => "Camera Maker", "value" => "Pentax Corporation"), -- cgit v1.2.3