Skip to content

fix: Pass charset/Security into ErrorHandler mock controller bootstrap - #559

Merged
hellopablo merged 1 commit into
nails:feature/pre-new-adminfrom
hellopablo:fix/errorhandler-ci-security-charset
Sep 7, 2026
Merged

fix: Pass charset/Security into ErrorHandler mock controller bootstrap#559
hellopablo merged 1 commit into
nails:feature/pre-new-adminfrom
hellopablo:fix/errorhandler-ci-security-charset

Conversation

@hellopablo

Copy link
Copy Markdown
Member

Problem

Fatal error screens cascade into a second fatal:

ArgumentCountError: Too few arguments to function CI_Security::__construct(),
0 passed in .../Common.php:196 and exactly 1 expected

Stack: ErrorHandler::instantiateMockController()load_class('Security', 'core').

Cause

pocketarc/codeigniter requires:

  • CI_Security::__construct($charset)
  • CI_Input::__construct(CI_Security &$security)

and boots them as:

$SEC =& load_class('Security', 'core', $charset);
$IN  =& load_class('Input', 'core', $SEC);

instantiateMockController() still called both with no args. This became reachable after the renderErrorView() guard changed from CI_Lang/MX_Lang to get_instance() (FormValidation/Translation work).

Fix

Pass charset into Security and the Security instance into Input, matching CodeIgniter’s bootstrap.

Follow-up

Bump consuming apps’ composer.lock once this lands on feature/pre-new-admin.

pocketarc/codeigniter requires CI_Security($charset) and CI_Input(CI_Security). instantiateMockController() was still calling load_class() with no args, causing ArgumentCountError while rendering fatal error screens after the get_instance() guard change.
@hellopablo
hellopablo merged commit d1684e7 into nails:feature/pre-new-admin Sep 7, 2026
4 checks passed
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