]> git.mxchange.org Git - friendica.git/commitdiff
Possibly Avoid database error when storing photo item
authorMichael <heluecht@pirati.ca>
Tue, 30 Nov 2021 06:05:37 +0000 (06:05 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 30 Nov 2021 06:05:37 +0000 (06:05 +0000)
include/api.php

index cacb83ca9c36f37a62b4b063093ed93866bd7fad..a982d4c7bc85df72983acba2b3347c2fd4b65f87 100644 (file)
@@ -411,9 +411,9 @@ function post_photo_item($hash, $allow_cid, $deny_cid, $allow_gid, $deny_gid, $f
 
        $arr = [];
        $arr['guid']          = System::createUUID();
-       $arr['uid']           = intval($uid);
+       $arr['uid']           = $uid;
        $arr['uri']           = $uri;
-       $arr['type']          = 'photo';
+       $arr['post-type']     = Item::PT_IMAGE;
        $arr['wall']          = 1;
        $arr['resource-id']   = $hash;
        $arr['contact-id']    = $owner_record['id'];
@@ -423,7 +423,7 @@ function post_photo_item($hash, $allow_cid, $deny_cid, $allow_gid, $deny_gid, $f
        $arr['author-name']   = $owner_record['name'];
        $arr['author-link']   = $owner_record['url'];
        $arr['author-avatar'] = $owner_record['thumb'];
-       $arr['title']         = "";
+       $arr['title']         = '';
        $arr['allow_cid']     = $allow_cid;
        $arr['allow_gid']     = $allow_gid;
        $arr['deny_cid']      = $deny_cid;