User tests: Successful: Unsuccessful:
Pull Request resolves #47496.
AbstractView::getModel() accessed $this->_models[strtolower($name)] directly without checking whether the key exists. When getModel() is called with a model name that has not been registered via addModel(), PHP 8.x raises an undefined array key warning.
Fix: extract the key to a variable and use the null coalescing operator (?? null) instead of direct array access. Updated the @return docblock to reflect the nullable return type.
AbstractView.$view->getModel('nonexistent') without having called addModel() first.null silently, no warning.PHP Warning: Undefined array key "" in libraries/src/MVC/View/AbstractView.php on line 197
No PHP warning. getModel() returns null when the requested model has not been registered.
| Status | New | ⇒ | Pending |
| Category | ⇒ | Libraries |
| Labels |
Added:
PR-5.4-dev
|
||
Rebased on latest 5.4-dev — no logical changes, only conflict-free replay of the single commit. Prior CI run had one flaky edge browser system test fail; the clean unit/integration/PHPStan matrix all passed. This push should retrigger CI.
Closing — opened 9 days ago, CI green, rebased twice, no review or feedback. Hard to sustain contribution effort without any engagement. The fix is here if anyone wants to continue it.
| Status | Pending | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2026-04-22 07:42:43 |
| Closed_By | ⇒ | arnoldwender |
Closing — opened 9 days ago, CI green, rebased twice, no review or feedback. Hard to sustain contribution effort without any engagement. The fix is here if anyone wants to continue it.
Every pull request needs 2 successful human tests by contributors different to the author, and then release managers can merge it. That can take some time sometimes. You cannot expect your PR being merged within days, especially not in a volunteer driven project where we all do not do our work on a paid base and we have regular hubs beside our activities for Joomla.
Rebased on latest
5.4-dev— no logical changes, only conflict resolution.