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 ed54330..608d01c 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 11de99b..e02be95 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;
                        }