[TESTS] Fix Core/ControllerTest
This commit is contained in:
@@ -88,21 +88,23 @@ class PinnedNotes extends Plugin
|
||||
$locale = Common::currentLanguage()->getLocale();
|
||||
$notes = Collection::query('pinned:true actor:' . $actor->getId(), 1, $locale, $actor);
|
||||
|
||||
$res[] = Formatting::twigRenderFile('PinnedNotes/notes.html.twig', ['pinnednotes' => $notes['notes']]);
|
||||
$res[] = Formatting::twigRenderFile('PinnedNotes/notes.html.twig', ['pinned_notes' => $notes['notes']]);
|
||||
|
||||
return Event::next;
|
||||
}
|
||||
|
||||
public function onCollectionQueryAddJoins(QueryBuilder &$note_qb, QueryBuilder &$actor_qb): bool
|
||||
{
|
||||
$note_qb->leftJoin(E\PinnedNotes::class, 'pinned', Expr\Join::WITH, 'note.id = pinned.note_id');
|
||||
if (!\in_array('pinned_notes', $note_qb->getAllAliases())) {
|
||||
$note_qb->leftJoin(E\PinnedNotes::class, 'pinned_notes', Expr\Join::WITH, 'note.id = pinned_notes.note_id');
|
||||
}
|
||||
return Event::next;
|
||||
}
|
||||
|
||||
public function onCollectionQueryCreateExpression(ExpressionBuilder $eb, string $term, ?string $language, ?Actor $actor, &$note_expr, &$actor_expr): bool
|
||||
{
|
||||
if ($term === 'pinned:true') {
|
||||
$note_expr = $eb->neq('pinned', null);
|
||||
$note_expr = $eb->neq('pinned_notes', null);
|
||||
return Event::stop;
|
||||
}
|
||||
if (str_starts_with($term, 'actor:')) {
|
||||
|
Reference in New Issue
Block a user