From 3810b483cf7a8cdda74289fcb547b60f9eea0eac Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Thu, 7 Dec 2017 23:32:49 -0500 Subject: [PATCH 1/3] Fix undefined Imagick::scaleDown error --- src/Object/Image.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Object/Image.php b/src/Object/Image.php index 79fbf3a990..f5ba1537af 100644 --- a/src/Object/Image.php +++ b/src/Object/Image.php @@ -350,7 +350,7 @@ class Image // FIXME - implement horizantal bias for scaling as in followin GD functions // to allow very tall images to be constrained only horizontally. - $this->image->scaleDown($dest_width, $dest_height); + $this->image->scaleImage($dest_width, $dest_height); } while ($this->image->nextImage()); // These may not be necessary any more From d50d693fe30a2520e018b682bee1a6163845b463 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Thu, 7 Dec 2017 23:33:36 -0500 Subject: [PATCH 2/3] Finish renaming Object\Item to Object\Post --- include/conversation.php | 4 ++-- src/Object/Post.php | 2 +- src/Object/Thread.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index ce937a7a71..6dd1a473ec 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -10,7 +10,7 @@ use Friendica\Core\System; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Object\Thread; -use Friendica\Object\Item; +use Friendica\Object\Post; require_once "include/bbcode.php"; require_once "include/acl_selectors.php"; @@ -880,7 +880,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false) { $item['pagedrop'] = $page_dropping; if ($item['id'] == $item['parent']) { - $item_object = new Item($item); + $item_object = new Post($item); $conv->addParent($item_object); } } diff --git a/src/Object/Post.php b/src/Object/Post.php index 231f2a5b84..8d56034a5e 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -45,7 +45,7 @@ class Post extends BaseObject * * @param array $data data array */ - public function __construct($data) + public function __construct(array $data) { $a = self::getApp(); diff --git a/src/Object/Thread.php b/src/Object/Thread.php index 2a72f0f659..d159f41c96 100644 --- a/src/Object/Thread.php +++ b/src/Object/Thread.php @@ -5,7 +5,7 @@ namespace Friendica\Object; use Friendica\BaseObject; -use Friendica\Object\Item; +use Friendica\Object\Post; require_once 'boot.php'; require_once 'include/text.php'; @@ -120,7 +120,7 @@ class Thread extends BaseObject * @return mixed The inserted item on success * false on failure */ - public function addParent($item) + public function addParent(Post $item) { $item_id = $item->getId(); From ee273e65489c633088260aad189d864b824ab7c0 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Thu, 7 Dec 2017 23:36:33 -0500 Subject: [PATCH 3/3] Fix class Object\Item not found in Object\Post --- src/Object/Post.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Object/Post.php b/src/Object/Post.php index 8d56034a5e..902435b513 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -89,7 +89,7 @@ class Post extends BaseObject } $item['pagedrop'] = $data['pagedrop']; - $child = new Item($item); + $child = new Post($item); $this->addChild($child); } } @@ -471,14 +471,14 @@ class Post extends BaseObject * * @return mixed */ - public function addChild(Item $item) + public function addChild(Post $item) { $item_id = $item->getId(); if (!$item_id) { - logger('[ERROR] Item::addChild : Item has no ID!!', LOGGER_DEBUG); + logger('[ERROR] Post::addChild : Item has no ID!!', LOGGER_DEBUG); return false; } elseif ($this->getChild($item->getId())) { - logger('[WARN] Item::addChild : Item already exists ('. $item->getId() .').', LOGGER_DEBUG); + logger('[WARN] Post::addChild : Item already exists ('. $item->getId() .').', LOGGER_DEBUG); return false; } /*