Skip to content

Commit

Permalink
release 1.16.1 (#2938)
Browse files Browse the repository at this point in the history
* optional csrf token name
* fix regression when selecting all projects as super user
* prevent invalid sql
  • Loading branch information
kevinpapst committed Nov 16, 2021
1 parent 99ebd1d commit c858edf
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/Repository/ProjectRepository.php
Expand Up @@ -372,7 +372,9 @@ private function getQueryBuilderForQuery(ProjectQuery $query): QueryBuilder
// begin > from and end < to
// ... and more ...
$times = $this->addProjectStartAndEndDate($qb, $query->getProjectStart(), $query->getProjectEnd());
$qb->andWhere($times);
if ($times->count() > 0) {
$qb->andWhere($times);
}

$this->addPermissionCriteria($qb, $query->getCurrentUser());

Expand Down
4 changes: 3 additions & 1 deletion src/Repository/TeamRepository.php
Expand Up @@ -228,6 +228,8 @@ private function addPermissionCriteria(QueryBuilder $qb, ?User $user = null, arr
$qb->setParameter('teamIds', array_unique($ids));
}

$qb->andWhere($or);
if ($or->count() > 0) {
$qb->andWhere($or);
}
}
}
4 changes: 2 additions & 2 deletions src/Repository/TimesheetRepository.php
Expand Up @@ -533,8 +533,8 @@ protected function getDailyData(DateTime $begin, DateTime $end, ?User $user = nu
$or->add($qb->expr()->between('t.end', ':begin', ':end'));

$qb->select('t, p, a, c')
->from(Timesheet::class, 't')
->andWhere($qb->expr()->isNotNull('t.end'))
->from(Timesheet::class, 't')
->andWhere($qb->expr()->isNotNull('t.end'))
->andWhere($or)
->orderBy('t.begin', 'DESC')
->setParameter('begin', $begin)
Expand Down
2 changes: 1 addition & 1 deletion templates/embeds/comments.html.twig
@@ -1,4 +1,4 @@
{% embed '@AdminLTE/Widgets/box-widget.html.twig' with {'form': form, 'comments': comments, 'route_pin': route_pin|default(null), 'route_delete': route_delete|default(null), 'delete_by_user': delete_by_user|default(false), 'csrf_delete': csrf_token(csrf_delete), 'csrf_pin': csrf_token(csrf_pin)} %}
{% embed '@AdminLTE/Widgets/box-widget.html.twig' with {'form': form, 'comments': comments, 'route_pin': route_pin|default(null), 'route_delete': route_delete|default(null), 'delete_by_user': delete_by_user|default(false), 'csrf_delete': csrf_token(csrf_delete|default('comment.delete')), 'csrf_pin': csrf_token(csrf_pin|default('comment.pin'))} %}
{% import "macros/widgets.html.twig" as widgets %}
{% block box_title %}{{ 'label.comment'|trans }}{% endblock %}
{% block box_attributes %}id="comments_box"{% endblock %}
Expand Down

0 comments on commit c858edf

Please sign in to comment.