From 68cd4e9a448b310cbc91dbfc041ef0dc94559592 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 19 Sep 2014 00:43:52 +0200 Subject: [PATCH] Fixed: ----------------------------- Argument 2 passed to Ostatus_profile::notifyDeferred() must be an instance of Profile, instance of User given, called in /var/www/htdocs/plugins/OStatus/lib/ostatusqueuehandler.php on line 156 and defined (/var/www/htdocs/plugins/OStatus/classes/Ostatus_profile.php:363) [ABORT] ----------------------------- getProfile() must be called on this->user Plus fixed/added some type-hints. Signed-off-by: Roland Haeder --- classes/Avatar.php | 6 ++++++ lib/activityutils.php | 4 ++-- plugins/OStatus/lib/ostatusqueuehandler.php | 2 +- plugins/OStatus/scripts/update_ostatus_profiles.php | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/classes/Avatar.php b/classes/Avatar.php index 5557533ed0..2dd481ae73 100644 --- a/classes/Avatar.php +++ b/classes/Avatar.php @@ -203,6 +203,12 @@ class Avatar extends Managed_DataObject try { return self::byProfile($target, $width, $height)->displayUrl(); } catch (Exception $e) { + common_debug(sprintf('target=>id=%s,width=%s,height=%s,message=%s', + $target->id, + $width, + $height, + $e->getMessage() + )); return self::defaultImage($width); } } diff --git a/lib/activityutils.php b/lib/activityutils.php index b83bc0a238..1ca63e2033 100644 --- a/lib/activityutils.php +++ b/lib/activityutils.php @@ -354,10 +354,10 @@ class ActivityUtils return null; } - static function compareTypes($type, $objects) + static function compareTypes($type, array $objects) { $type = self::resolveUri($type, false); - foreach ((array)$objects as $object) { + foreach ($objects as $object) { if ($type === self::resolveUri($object)) { return true; } diff --git a/plugins/OStatus/lib/ostatusqueuehandler.php b/plugins/OStatus/lib/ostatusqueuehandler.php index 21a9a37e3c..f3e3f80858 100644 --- a/plugins/OStatus/lib/ostatusqueuehandler.php +++ b/plugins/OStatus/lib/ostatusqueuehandler.php @@ -173,7 +173,7 @@ class OStatusQueueHandler extends QueueHandler // remote user or group. // @fixme as an optimization we can skip this if the // remote profile is subscribed to the author. - $oprofile->notifyDeferred($this->notice, $this->user); + $oprofile->notifyDeferred($this->notice, $this->user->getProfile()); } } diff --git a/plugins/OStatus/scripts/update_ostatus_profiles.php b/plugins/OStatus/scripts/update_ostatus_profiles.php index 45ee856264..0a7a23e63f 100755 --- a/plugins/OStatus/scripts/update_ostatus_profiles.php +++ b/plugins/OStatus/scripts/update_ostatus_profiles.php @@ -54,7 +54,7 @@ class LooseOstatusProfile extends Ostatus_profile * @throws Exception on various error conditions * @throws OStatusShadowException if this reference would obscure a local user/group */ - public static function updateProfileURL($profile_url, $hints=array()) + public static function updateProfileURL($profile_url, array $hints=array()) { $oprofile = null; -- 2.39.5