Repository navigation
Conversation
Since GLPI 11, legacy front/ scripts are included from inside LegacyFileLoadController::__invoke(), so they no longer run in the global scope. The final else branch used $CFG_GLPI without declaring it global: two PHP warnings were logged on every direct access and root_doc evaluated to null, sending instances installed in a subdirectory to /front/config.form.php outside of GLPI. Fixes pluginsGLPI#166 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #166
Since GLPI 11, legacy
front/scripts are included from insideGlpi\Controller\LegacyFileLoadController::__invoke(), so they no longer run in the global scope. The finalelsebranch offront/config.form.phpused$CFG_GLPIwithout declaring it global (the@varannotation only documents it), which caused:php-errors.logon every direct access (Undefined variable $CFG_GLPIandTrying to access array offset on value of type null, line 51);root_docevaluating tonull, so the redirect went to/front/config.form.php— outside of GLPI for instances installed in a subdirectory.Changes
front/config.form.php: addglobal $CFG_GLPI;before the redirect.CHANGELOG.md: entry under[Unreleased].Tested
Same one-line change applied on a production GLPI 11.0.12 instance (plugin 1.4.3, same code as
main): openingplugins/metabase/front/config.form.phpnow redirects to the Metabase configuration tab and no warning is logged.🤖 Generated with Claude Code