Skip to content

Fix BBUDDY_EXTERNAL_GROCY_URL env var being ignored#291

Open
goto1134 wants to merge 5 commits intoForceu:masterfrom
goto1134:fix/external-grocy-url-env-var
Open

Fix BBUDDY_EXTERNAL_GROCY_URL env var being ignored#291
goto1134 wants to merge 5 commits intoForceu:masterfrom
goto1134:fix/external-grocy-url-env-var

Conversation

@goto1134
Copy link

@goto1134 goto1134 commented Feb 14, 2026

Summary

  • Fixes BBUDDY_EXTERNAL_GROCY_URL not working properly #230: BBUDDY_EXTERNAL_GROCY_URL environment variable was silently discarded, causing the Grocy header link to always show the internal API URL instead of the configured external URL.
  • Root cause: convertCorrectType() cast env var values to match the default config type. Since EXTERNAL_GROCY_URL defaults to null, settype($result, "NULL") converted any string value back to null.
  • Fix: when the original config default is null, return the string value directly (after boolean conversion) instead of attempting a type cast to NULL.
  • Adds PHPUnit 9 and tests for convertCorrectType() covering null, string, integer, boolean, and array conversions.

Notes

  • nikic/php-parser version bumped from 4.12.0 to ^4.19.1 to resolve dependency conflicts with PHPUnit 9.

🤖 Generated with Claude Code

goto1134 and others added 5 commits February 14, 2026 13:21
…eu#230

convertCorrectType() was casting env var values to match the type of the
default config value. For EXTERNAL_GROCY_URL (default: null), this meant
settype($result, "NULL") converted any string value back to null,
effectively discarding the env var. Return the value directly when the
original config default is null.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

BBUDDY_EXTERNAL_GROCY_URL not working properly

1 participant