Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

admin activity: visibility "none" (no filter) causes sql-error #491

Closed
lduer opened this issue Jan 10, 2019 · 3 comments
Closed

admin activity: visibility "none" (no filter) causes sql-error #491

lduer opened this issue Jan 10, 2019 · 3 comments
Labels

Comments

@lduer
Copy link
Contributor

lduer commented Jan 10, 2019

Describe the bug
In the admin-activities list, the select list of "visibility" causes an exception, when selecting the "empty" line (display both: visible and invisble activities).

An exception has been thrown during the rendering of a template ("[Syntax Error] line 0, col 94: Error: Expected Literal, got 'ORDER'").

The QueryException:

Doctrine\ORM\Query\ QueryException

SELECT a, p, c FROM App\Entity\Activity a LEFT JOIN a.project p LEFT JOIN p.customer c WHERE ORDER BY a.id ASC

To Reproduce
Steps to reproduce the behavior:

  1. Navigate to "Admin" -> "Activities"
  2. Click on the Filter Icon to display the filter-form
  3. Select the empty row in the "visible" dropdown
  4. See error.
    (direct navigation to the Error: your-kimai.url/en/admin/activity/?customer=&pageSize=&project=&visibility=3

Additional context
The Exception itself is caused by the template, when calling {{ entries.count }}, while entries is the Pagerfanta\Pagerfanta object. This causes the error when accessing $entries->count().

@lduer
Copy link
Contributor Author

lduer commented Jan 10, 2019

After investigation, I found out that the error only occurs if there is no other than the visibility selected in the form.

The findByQuery() creates an empty $where and generates the SQL-error: https://github.com/kevinpapst/kimai2/blob/master/src/Repository/ActivityRepository.php#L148

@lduer lduer changed the title admin activity: visibility "none" (no filter) causes error admin activity: visibility "none" (no filter) causes sql-error Jan 10, 2019
@kevinpapst kevinpapst added the bug label Jan 18, 2019
@kevinpapst
Copy link
Member

Thanks for the investigation! Should be fixed with the attached PR #506

@kevinpapst kevinpapst added this to the 0.7 - Permissions milestone Jan 18, 2019
@lock
Copy link

lock bot commented Mar 19, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. If you use Kimai on a daily basis, please consider donating to support further development of Kimai.

@lock lock bot locked and limited conversation to collaborators Mar 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants