Only build tag and file when really needed

This commit is contained in:
Michael 2018-07-08 05:44:35 +00:00
parent 69db696ab1
commit c2d4b557ae

View file

@ -189,6 +189,7 @@ class Item extends BaseObject
} }
} }
if (!array_key_exists('verb', $row) || in_array($row['verb'], ['', ACTIVITY_POST, ACTIVITY_SHARE])) {
// Build the tag string out of the term entries // Build the tag string out of the term entries
if (array_key_exists('tag', $row) && empty($row['tag'])) { if (array_key_exists('tag', $row) && empty($row['tag'])) {
$row['tag'] = Term::tagTextFromItemId($row['internal-iid']); $row['tag'] = Term::tagTextFromItemId($row['internal-iid']);
@ -198,6 +199,7 @@ class Item extends BaseObject
if (array_key_exists('file', $row) && empty($row['file'])) { if (array_key_exists('file', $row) && empty($row['file'])) {
$row['file'] = Term::fileTextFromItemId($row['internal-iid']); $row['file'] = Term::fileTextFromItemId($row['internal-iid']);
} }
}
// Remove internal fields // Remove internal fields
unset($row['internal-activity']); unset($row['internal-activity']);