Fix feature flags not being disabled when set to false#532
Conversation
WalkthroughThis change modifies the PHP-FPM runtime configuration script to disable Grocy feature flags by assigning empty strings instead of numeric zeros to environment variables. Nineteen feature-related variables are updated, including batteries, calendar, chores, equipment, recipes, shopping list, stock, tasks, and printer options. Changes
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Proposed Changes
Fixes feature flags and toggles not taking effect when disabled in the addon configuration.
Grocy passes feature flag environment variables through to JavaScript, where it evaluates them as booleans. The app was exporting disabled flags as
"0", which PHP correctly interprets as falsy but JavaScript evaluates as truthy (non-empty string), causing disabled features to still render as enabled in the UI.Changed all disable assignments from
=0to="", empty string is falsy in both PHP and JavaScript.Related Issues
fixes #490
fixes #461
fixes #518
Summary by CodeRabbit