From c2d4b557aeb4b6eb9eee2a6b65b18ab7bf6efe39 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 8 Jul 2018 05:44:35 +0000 Subject: [PATCH] Only build tag and file when really needed --- src/Model/Item.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index b5903b9999..8a96e54405 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -189,14 +189,16 @@ class Item extends BaseObject } } - // Build the tag string out of the term entries - if (array_key_exists('tag', $row) && empty($row['tag'])) { - $row['tag'] = Term::tagTextFromItemId($row['internal-iid']); - } + if (!array_key_exists('verb', $row) || in_array($row['verb'], ['', ACTIVITY_POST, ACTIVITY_SHARE])) { + // Build the tag string out of the term entries + if (array_key_exists('tag', $row) && empty($row['tag'])) { + $row['tag'] = Term::tagTextFromItemId($row['internal-iid']); + } - // Build the file string out of the term entries - if (array_key_exists('file', $row) && empty($row['file'])) { - $row['file'] = Term::fileTextFromItemId($row['internal-iid']); + // Build the file string out of the term entries + if (array_key_exists('file', $row) && empty($row['file'])) { + $row['file'] = Term::fileTextFromItemId($row['internal-iid']); + } } // Remove internal fields