Fix doc update-by-ID problem
- Rework imports for pages - Ready for final end-to-end test before merge
This commit is contained in:
@@ -269,9 +269,7 @@ class Feed
|
||||
*/
|
||||
public static function retrieveById(int $feedId): static|false
|
||||
{
|
||||
define('PDO_DOC_DEBUG_SQL', true);
|
||||
$doc = Find::byId(Table::FEED, $feedId, static::class);
|
||||
echo "Feed $feedId: " . ($doc ? 'found it' : 'not found');
|
||||
return $doc && $doc->user_id == $_SESSION[Key::USER_ID] ? $doc : false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ class ItemList
|
||||
$this->dbList = Custom::list(
|
||||
ItemWithFeed::SELECT_WITH_FEED . ' WHERE '
|
||||
. Query::whereByFields(array_filter($allFields, fn($it) => $it->paramName <> ':search'))
|
||||
. $searchWhere,
|
||||
. "$searchWhere ORDER BY coalesce(item.data->>'updated_on', item.data->>'published_on') DESC",
|
||||
Parameters::addFields($allFields, []), new DocumentMapper(ItemWithFeed::class));
|
||||
} catch (DocumentException $ex) {
|
||||
$this->error = "$ex";
|
||||
|
||||
Reference in New Issue
Block a user