Skip to content

fix(prefs): guard config-file storage against null $registry global#195

Merged
ralflang merged 1 commit into
FRAMEWORK_6_0from
fix/prefs-storage-null-registry-guard
Jul 8, 2026
Merged

fix(prefs): guard config-file storage against null $registry global#195
ralflang merged 1 commit into
FRAMEWORK_6_0from
fix/prefs-storage-null-registry-guard

Conversation

@ralflang

@ralflang ralflang commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary

Horde_Core_Prefs_Storage_Configuration::get() reaches out to global $registry to load prefs.php defaults. Under modern PSR-15 request paths (e.g. the admin REST API — Horde\Horde\Admin\UserController::get()IdentityService::getAll()SqlPrefsService::getValue()), $GLOBALS['registry'] is never populated and the class fatals with Call to a member function loadConfigFile() on null.

Add a guard: when $registry isn't a Horde_Registry instance, return $scope_ob unchanged. Same graceful fallback shape the existing try/catch uses when prefs.php doesn't exist. Downstream storage drivers (SQL etc.) still supply real user preferences.

Reproducer against a locally-installed Horde:

hordectl query user admin
→ ❌ 500 Internal Server Error (before)
→ 200 with user payload (after)

Config-file defaults are best-effort atop user prefs. When we can't reach the registry to load them, "skip defaults, fall through to real storage" is the right degrade.

Reported while dogfooding hordectl webserver-config in horde/hordectl PR #17 CI. Surfaces on any admin REST API call that touches IdentityService.

@ralflang ralflang merged commit a05bf39 into FRAMEWORK_6_0 Jul 8, 2026
1 check failed
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.

1 participant