Replace rowCount() with explicit count primitive function. This is necessary due to sqlite driver always returning 0 on rowCount (this is documented behaviour: https://www.php.net/manual/en/pdostatement.rowcount.php)

Signed-off-by: Raul <raul@nextcloud.com>
This commit is contained in:
Raul
2022-04-13 10:38:32 +02:00
parent 8c1e53a8df
commit 04974d37d6
3 changed files with 6 additions and 6 deletions

View File

@@ -131,13 +131,13 @@ class StackMapper extends DeckMapper implements IPermissionMapper {
*/
public function isOwner($userId, $stackId): bool {
$qb = $this->db->getQueryBuilder();
$qb->select('*')
$qb->select('s.id')
->from($this->getTableName(), 's')
->innerJoin('s', 'deck_boards', 'b', 'b.id = s.board_id')
->where($qb->expr()->eq('s.id', $qb->createNamedParameter($stackId, IQueryBuilder::PARAM_INT)))
->andWhere($qb->expr()->eq('owner', $qb->createNamedParameter($userId, IQueryBuilder::PARAM_STR)));
return $qb->executeQuery()->rowCount() > 0;
return count($qb->executeQuery()->fetchAll()) > 0;
}
/**