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

bug error #4

Open
clayme2019 opened this issue Dec 5, 2019 · 7 comments
Open

bug error #4

clayme2019 opened this issue Dec 5, 2019 · 7 comments

Comments

@clayme2019
Copy link

Screenshot_4
I installed it correctly, but when I click the button

Screenshot_5

Screenshot_6

what could i have done wrong?

@clayme2019
Copy link
Author

Current PHP version 7.2

@clayme2019
Copy link
Author

Screenshot_7

@clayme2019
Copy link
Author

please

@clayme2019
Copy link
Author

help me
please

@BKapelari
Copy link

Have the same problem

@rafaelgou
Copy link

rafaelgou commented Feb 2, 2020

Having the same problem.

Cause: there's a reference to a non-existent template:

[2020-02-02 00:30:18] request.CRITICAL: Uncaught PHP Exception Twig\Error\LoaderError: "Unable to find template "macros/actions.html.twig" (looked into: /opt/kimai/templates, /opt/kimai/vendor/symfony/twig-bridge/Resources/views/Form) in "@ReadOnlyAccess/index.html.twig" at line 5." at /opt/kimai/vendor/twig/twig/src/Loader/FilesystemLoader.php line 250 {"exception":"[object] (Twig\\Error\\LoaderError(code: 0): Unable to find template \"macros/actions.html.twig\" (looked into: /opt/kimai/templates, /opt/kimai/vendor/symfony/twig-bridge/Resources/views/Form) in \"@ReadOnlyAccess/index.html.twig\" at line 5. at /opt/kimai/vendor/twig/twig/src/Loader/FilesystemLoader.php:250)"} []
[2020-02-02 00:30:18] security.DEBUG: Stored the security token in the session. {"key":"_security_secured_area"} []

So a solution:

  • edit the file plugins/ReadOnlyAccessBundle/Resources/views/index.html.twig
  • remove the line {% import "macros/actions.html.twig" as actions %}
  • clear an warmup the cache:
cd kimai/
bin/console cache:clear
bin/console cache:warmup

Then you get the page back.

I created a pull request: #5

If somebody is in hurry can clone from my fork with this fix: https://github.com/rafaelgou/ReadOnlyAccessBundle

@ftrojahn
Copy link

There's another one: if the readonly-user clicks on the "Show Recorded Times" page:

Spoiler: critical exception
request.CRITICAL: Uncaught PHP Exception Twig\Error\LoaderError: "Unable to find template "macros/actions.html.twig" (looked into: /home/time/kimai2/templates, /home/time/kimai2/vendor/symfon
y/twig-bridge/Resources/views/Form) in "@ReadOnlyAccess/showCustomerTimes.html.twig" at line 5." at /home/time/kimai2/vendor/twig/twig/src/Loader/FilesystemLoader.php line 250 {"exception":"[object] (Twig\\Error\\
LoaderError(code: 0): Unable to find template \"macros/actions.html.twig\" (looked into: /home/time/kimai2/templates, /home/time/kimai2/vendor/symfony/twig-bridge/Resources/views/Form) in \"@ReadOnlyAccess/showCus
tomerTimes.html.twig\" at line 5. at /home/time/kimai2/vendor/twig/twig/src/Loader/FilesystemLoader.php:250)"} []

So, you have to delete the same line in the file Resources/views/showCustomerTimes.html.twig

Spoiler: patch
diff --git a/Resources/views/showCustomerTimes.html.twig b/Resources/views/showCustomerTimes.html.twig
index 0a00c5e..9921c9a 100644
--- a/Resources/views/showCustomerTimes.html.twig
+++ b/Resources/views/showCustomerTimes.html.twig
@@ -2,7 +2,6 @@
 {% import "macros/widgets.html.twig" as widgets %}
 {% import "macros/datatables.html.twig" as tables %}
 {% import "macros/toolbar.html.twig" as toolbar %}
-{% import "macros/actions.html.twig" as actions %}

 {% set columns = {
     'date': 'alwaysVisible',

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants