You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When not logged in, this warning appears on the login page:
Warning: Use of undefined constant GROCY_USER_ID - assumed 'GROCY_USER_ID' (this will throw an Error in a future version of PHP) in /srv/www/grocy/controllers/BaseController.php on line 162
It's a warning, not an error, so this is an enhancement, not a bug.
Of course, could be improved, however I don't care too much about warnings, there will probably a lot more places - simply disable them (which is IMHO the default/recommended setting for production environments).
berrnd
changed the title
Bug: Use of undefined constant GROCY_USER_ID in controllers/BaseController.php on line 162
Use of undefined constant GROCY_USER_ID (warning/notice)
Jan 12, 2021
I agree with etam, there should be a check if the constant is actually defined. At the moment this can potentially lead to bugs or even errors in future PHP versions.
This is one place were the warning is rendered to visible markup, there are (for sure) a lot of other places where warnings pop up in not visible markup - so always kind of funny that when it's visible, it's important to a lot of people, otherwise not...
So I rather have fixed the most important thing immediately. ;D
Grocy: version: 3.0.1
PHP version: 7.4.6
When not logged in, this warning appears on the login page:
It refers to this line:
https://github.com/grocy/grocy/blob/v3.0.1/controllers/BaseController.php#L162
Obviously it's an error to call
GetUserSetting
, when no user is logged in.The text was updated successfully, but these errors were encountered: