User tests: Successful: Unsuccessful:
Fixes #46369
This PR restores the caching and data-loading behavior that was lost when
the getInstance() methods were removed from the core classes.
FormFactory
private static array $forms)clearCache() for tests/runtime reloadsUserFactory
private static array $cache)clearCache() for testing and runtime reloadsForm::getInstance()User::getInstance() implementations.FormFactory::createForm() multiple times with the same name — ✅ should return the same instance.UserFactory::loadUserById() or loadUserByUsername() repeatedly — ✅ should only query DB once.| Status | New | ⇒ | Pending |
| Category | ⇒ | Libraries |
| Labels |
Added:
PR-5.4-dev
|
||
Please create a new caching factory. This here is a bc break. That's why we intended interfaces to abstract different logic.
@sshekhar563 Do I assume right that you latest refactoring has implemented @laoneo 's suggestion?
@laoneo Could you check and report back if it's ok now?
| Title |
|
||||||
@sshekhar563 Sorry, but your last commit was wrong. Why are you changing the indentation from spaces to tabulators in the FormFactory.php and UserFactory.php file? If you simply had applied my change suggestions instead of force-pushing a wrong change, it would be ok now.
| Category | Libraries | ⇒ | Repository SQL Administration com_admin Postgresql com_config Language & Strings NPM Change |
@sshekhar563 Please check your changes on GitHub! You are changing 37 files. Please stop to force push your changes. Do normal pushes. Or if you can't handle it, close this PR and open a new one.
Hi @richard67
Thank you for the feedback and for pointing this out 🙏
I understand that my current branch has too many unintended file changes due to line-ending normalization and previous force pushes.
I’ll be closing this PR and creating a new clean one soon, based on the latest 5.4-dev branch, which will include only the relevant files (FormFactory, UserFactory, and their new caching factories).
The new PR will be PHPCS-compliant and have a clean commit history for easier review.
Thanks again for your patience and guidance I really appreciate your help while I’m learning the contribution process. 🙏
| Status | Pending | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-11-08 12:51:13 |
| Closed_By | ⇒ | sshekhar563 | |
| Labels |
Added:
Language Change
NPM Resource Changed
|
||
@sshekhar563 When you have created the new PR, please post here a comment with a reference to that PR so interested readers can follow the previous discussions. Thanks in advance, and have success with the new PR.
Hi @richard67
This PR (#46428) replaces #46420 with a clean, PHPCS-compliant version based on 5.4-dev.
It includes only the intended factory changes and follows all previous feedback.
Thanks for help and guidance
Please create a new caching factory. This here is a bc break. That's why we intended interfaces to abstract different logic.