Merge pull request #10007 from annando/issue-9980

issue 9980: Field "type" does not exist anymore
This commit is contained in:
Hypolite Petovan 2021-03-07 19:46:42 -05:00 committed by GitHub
commit 830b9958c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4872,7 +4872,7 @@ function prepare_photo_data($type, $scale, $photo_id)
} }
// retrieve item element for getting activities (like, dislike etc.) related to photo // retrieve item element for getting activities (like, dislike etc.) related to photo
$condition = ['uid' => api_user(), 'resource-id' => $photo_id, 'type' => 'photo']; $condition = ['uid' => api_user(), 'resource-id' => $photo_id];
$item = Post::selectFirst(['id', 'uid', 'uri', 'parent', 'allow_cid', 'deny_cid', 'allow_gid', 'deny_gid'], $condition); $item = Post::selectFirst(['id', 'uid', 'uri', 'parent', 'allow_cid', 'deny_cid', 'allow_gid', 'deny_gid'], $condition);
if (!DBA::isResult($item)) { if (!DBA::isResult($item)) {
throw new NotFoundException('Photo-related item not found.'); throw new NotFoundException('Photo-related item not found.');
@ -4881,7 +4881,7 @@ function prepare_photo_data($type, $scale, $photo_id)
$data['photo']['friendica_activities'] = api_format_items_activities($item, $type); $data['photo']['friendica_activities'] = api_format_items_activities($item, $type);
// retrieve comments on photo // retrieve comments on photo
$condition = ["`parent` = ? AND `uid` = ? AND (`gravity` IN (?, ?) OR `type`='photo')", $condition = ["`parent` = ? AND `uid` = ? AND `gravity` IN (?, ?)",
$item['parent'], api_user(), GRAVITY_PARENT, GRAVITY_COMMENT]; $item['parent'], api_user(), GRAVITY_PARENT, GRAVITY_COMMENT];
$statuses = Post::selectForUser(api_user(), [], $condition); $statuses = Post::selectForUser(api_user(), [], $condition);