Skip to content

fix(config): ignore invalid custom split config#2242

Merged
Seiger merged 1 commit intoevolution-cms:3.5.xfrom
middleDuckAi:middleDuck/evo-2196-controller-namespace
Mar 24, 2026
Merged

fix(config): ignore invalid custom split config#2242
Seiger merged 1 commit intoevolution-cms:3.5.xfrom
middleDuckAi:middleDuck/evo-2196-controller-namespace

Conversation

@middleDuckAi
Copy link
Collaborator

Problem

Issue #2196 reports a white-screen / HTTP 500 after creating core/custom/config/cms/settings/ControllerNamespace.php. On current 3.5.x, the failure path comes from bootstrap config loading: an invalid custom split config file is required directly and kills the whole runtime with a ParseError.

Why

This PR makes the custom config layer resilient without hiding real platform breakage. Custom user config mistakes should not take down the whole application, but invalid core config should still stay fatal.

What Changed

  • wrapped config file loading in core/src/AbstractLaravel.php with a narrow ParseError guard
  • invalid files under core/custom/config/** are now skipped and logged instead of crashing bootstrap
  • invalid non-custom config files still throw as before
  • added a focused unit test that covers:
    • valid split custom config loading
    • invalid custom split config fallback
    • invalid non-custom config remaining fatal

Where

  • core/src/AbstractLaravel.php
  • core/tests/Unit/AbstractLaravelLoadConfigurationTest.php

Verification

  • ./vendor/bin/pest tests/Unit/AbstractLaravelLoadConfigurationTest.php
  • ./vendor/bin/pest tests/Feature/ModifiersTest.php
  • php -l core/src/AbstractLaravel.php
  • php -l core/tests/Unit/AbstractLaravelLoadConfigurationTest.php
  • manual bootstrap check with a broken core/custom/config/cms/settings/ControllerNamespace.php now logs and falls back instead of fataling

Remaining Gaps

  • this PR does not try to auto-fix the invalid PHP content itself
  • the broken custom config file is still ignored until the user corrects it

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.

2 participants