mirror of
https://github.com/moparisthebest/wallabag
synced 2024-12-18 05:32:23 -05:00
[fix] getEntryById now returns an array with one element
This commit is contained in:
parent
dddb6809eb
commit
bbd89215d8
@ -15,7 +15,7 @@ $front->get('/view/{id}', function (Request $request, $id) use ($app) {
|
||||
|
||||
$entry = $app['entry_api']->getEntryById($id);
|
||||
|
||||
return $app['twig']->render('view.twig', array('entry' => $entry));
|
||||
return $app['twig']->render('view.twig', array('entry' => $entry[0]));
|
||||
})
|
||||
->bind('view_entry');
|
||||
|
||||
|
@ -29,7 +29,7 @@ class EntryRepository
|
||||
$sql = "SELECT * FROM entries where id = ? AND user_id = ?";
|
||||
$entry = $this->db->fetchAll($sql, array($id, $userId));
|
||||
|
||||
return $entry ? $entry[0] : array();
|
||||
return $entry ? $entry : array();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user