]> git.mxchange.org Git - friendica.git/blobdiff - mod/photos.php
Merge pull request #10228 from MrPetovan/bug/warnings
[friendica.git] / mod / photos.php
index a23eefa7ed3b27cbcb754ae29e2cee05d8ab0e9e..df843846456d613522f83fa45d272402c1937a81 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -784,7 +784,7 @@ function photos_post(App $a)
        $arr['guid']          = System::createUUID();
        $arr['uid']           = $page_owner_uid;
        $arr['uri']           = $uri;
-       $arr['type']          = 'photo';
+       $arr['post-type']     = Item::PT_IMAGE;
        $arr['wall']          = 1;
        $arr['resource-id']   = $resource_id;
        $arr['contact-id']    = $owner_record['id'];
@@ -1266,7 +1266,7 @@ function photos_content(App $a)
                // as a "post" but displaying instead the photo it is linked to
 
                /// @todo Rewrite this query. To do so, $sql_extra must be changed
-               $linked_items = q("SELECT `id` FROM `post-view` WHERE `resource-id` = '%s' $sql_extra LIMIT 1",
+               $linked_items = q("SELECT `id` FROM `post-user-view` WHERE `resource-id` = '%s' $sql_extra LIMIT 1",
                        DBA::escape($datum)
                );
                if (DBA::isResult($linked_items)) {