From 229c9b8a8cf1bc99aa915473f856ba471e9dfb45 Mon Sep 17 00:00:00 2001 From: icewing Date: Tue, 15 Apr 2008 15:05:58 +0000 Subject: Marcus Povey * Modified to not throw exception on missing verb conversion git-svn-id: https://code.elgg.org/elgg/trunk@461 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/relationships.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/engine/lib/relationships.php b/engine/lib/relationships.php index bba930580..592e3ecea 100644 --- a/engine/lib/relationships.php +++ b/engine/lib/relationships.php @@ -149,16 +149,18 @@ // Map verb to relationship $verb = $data->getAttribute('verb'); - $this->attributes['relationship'] = get_relationship_from_verb($verb); - if (!$this->attributes['relationship']) - throw new ImportException("Could not import '$verb' as a relationship."); - - // save - $result = $this->save(); - if (!$result) - throw new ImportException("There was a problem saving the ElggExtender"); + $relationship = get_relationship_from_verb($verb); - return $this; + if ($relationship) + { + $this->attributes['relationship'] = $relationship; + // save + $result = $this->save(); + if (!$result) + throw new ImportException("There was a problem saving the ElggExtender"); + + return $this; + } } } } -- cgit v1.2.3