]> git.mxchange.org Git - friendica.git/commitdiff
Fix for vanishing notes (#5531)
authorMichael Vogel <icarus@dabo.de>
Tue, 31 Jul 2018 02:23:48 +0000 (04:23 +0200)
committerHypolite Petovan <mrpetovan@eml.cc>
Tue, 31 Jul 2018 02:23:48 +0000 (22:23 -0400)
* Fix for vanishing notes

* The field needs to be part of the selected fields ...

mod/notes.php
src/Model/Item.php

index ed54330b3c5c165011c3df4b93e5afa742ae646f..608d01cf8c63fbf1ed718788ab0eba5f5ffd3db6 100644 (file)
@@ -59,7 +59,7 @@ function notes_content(App $a, $update = false)
        }
 
        $condition = ['uid' => local_user(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => GRAVITY_PARENT,
-               'wall' => false, 'allow_cid' => '<' . $a->contact['id'] . '>', 'contact-id'=> $a->contact['id']];
+               'wall' => false, 'contact-id'=> $a->contact['id']];
 
        $a->set_pager_itemspage(40);
 
index 11de99bc46f8ab02325ee393d754c2c78b692d56..e02be950b18db3f48eee97dc6b17d72c01652350 100644 (file)
@@ -2855,7 +2855,7 @@ class Item extends BaseObject
                        $condition[] = $days;
                }
 
-               $items = self::select(['file', 'resource-id', 'starred', 'type', 'id'], $condition);
+               $items = self::select(['file', 'resource-id', 'starred', 'type', 'id', 'post-type'], $condition);
 
                if (!DBA::isResult($items)) {
                        return;
@@ -2887,9 +2887,9 @@ class Item extends BaseObject
                                continue;
                        } elseif (!$expire_starred && intval($item['starred'])) {
                                continue;
-                       } elseif (!$expire_notes && $item['type'] == 'note') {
+                       } elseif (!$expire_notes && (($item['type'] == 'note') || ($item['post-type'] == Item::PT_PERSONAL_NOTE))) {
                                continue;
-                       } elseif (!$expire_items && $item['type'] != 'note') {
+                       } elseif (!$expire_items && ($item['type'] != 'note') && ($item['post-type'] != Item::PT_PERSONAL_NOTE)) {
                                continue;
                        }