Browse Source

Fix for vanishing notes (#5531)

* Fix for vanishing notes

* The field needs to be part of the selected fields ...
pull/5534/head
Michael Vogel 3 years ago
committed by Hypolite Petovan
parent
commit
c39e0dcf2a
2 changed files with 4 additions and 4 deletions
  1. +1
    -1
      mod/notes.php
  2. +3
    -3
      src/Model/Item.php

+ 1
- 1
mod/notes.php View 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);


+ 3
- 3
src/Model/Item.php View 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;
}


Loading…
Cancel
Save