From 71c6bbd6db559848c7b7428d53fbe100de589f3c Mon Sep 17 00:00:00 2001 From: ben Date: Tue, 24 Feb 2009 17:45:59 +0000 Subject: Fixed error in notification procedure git-svn-id: https://code.elgg.org/elgg/trunk@2928 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/notification.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'engine/lib/notification.php') diff --git a/engine/lib/notification.php b/engine/lib/notification.php index b4c69f9b5..d73ecc439 100644 --- a/engine/lib/notification.php +++ b/engine/lib/notification.php @@ -383,7 +383,7 @@ $object_type = $object->getType(); if (empty($object_type)) $object_type = '__BLANK__'; $object_subtype = $object->getSubtype(); if (empty($object_subtype)) $object_subtype = '__BLANK__'; if (isset($CONFIG->register_objects[$object_type][$object_subtype])) { - + $descr = $CONFIG->register_objects[$object_type][$object_subtype]; $string = $descr . ": " . $object->getURL(); @@ -391,6 +391,7 @@ // (Person defined by container_guid so we can also subscribe to groups if we want) foreach($NOTIFICATION_HANDLERS as $method => $foo) if ($interested_users = get_entities_from_relationship('notify' . $method,$object->container_guid,true,'user','',0,'',99999)) { + if (is_array($interested_users)) foreach($interested_users as $user) { if ($user instanceof ElggUser) { @@ -400,9 +401,9 @@ $object->access_id == ACCESS_LOGGED_IN) && $object->access_id != ACCESS_PRIVATE && $user->guid != $SESSION['user']->guid - && $entity instanceof ElggEntity) { + && $object instanceof ElggEntity) { - $methodstring = trigger_plugin_hook('notify:entity:message',$entity->getType(),array( + $methodstring = trigger_plugin_hook('notify:entity:message',$object->getType(),array( 'entity' => $object, 'to_entity' => $user, 'method' => $method),$string); @@ -424,4 +425,4 @@ register_elgg_event_handler('init','system','notification_init',0); register_elgg_event_handler('create','object','object_notifications'); -?> \ No newline at end of file +?> -- cgit v1.2.3