User tests: Successful: Unsuccessful:
Added CacheControllerFactoryAwareInterface, DatabaseAwareInterface and DispatcherAwareInterface to the the MVCFactory. They were missing, since PR #47718 changed the way the dependencies are injected into the MVCFactory:
The MVCFactory uses all necessary traits to inject those dependencies, but doesn't mention the CacheControllerFactoryAwareInterface, DatabaseAwareInterface and DispatcherAwareInterface in its list of implemented interfaces. Ergo: they are not injected in the MVCFactory.
Because the MVCFactory still has some escape to get the database from
Factory::getContainer()->get(DatabaseInterface::class) when it is not provided, it won't fail... until that escape is removed in J7.0. The exceptions you would get for the missing CacheControllerFactory and Dispatcher are catched, without any error messages. Probably something will go wrong with dispatching plugins and with caching when trying to use them, but I didn't put the finger on that yet. Anyway: those interfaces were missing and added by this PR.
BTW: PR #45060 also shows that the Database is not injected by the MVCFactory into the BaseDatabaseModel, because the DatabaseAwareInterface is missing in the BaseDatabaseModel. It is a comparable mistake. At the moment a database is not injected into the MVCFactory and that doesn't inject it into the BaseDatabaseModel, double failure.
Everything should be working without errors.
To test the Database is not injected you could leave out the try-catch in the createTable() method (this test won't work in the createModel() method, because of the mistake that PR #45060 fixes). In the createTable lines 272-277 you'd then get:
$db = \array_key_exists('dbo', $config) ? $config['dbo'] : $this->getDatabase();
That would fail, for there is no database set. But after applying the patch it would work.
Everything seems to work, but three dependencies of the MVCFactory are not injected into it by its service provider. Because some errors are temporarily "fixed", you don't see error messages.
For the database, you could make this visible by leaving out the try-catch when injecting the database in the Table object (see above).
The correct dependencies will be put into the MVCFactory.
When the patch is applied you can leave out the try-catch in the createTable() method, so you see there is a database injected.
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Category | ⇒ | Libraries |
| Labels |
Added:
PR-6.2-dev
|
||
| Title |
|
||||||
Sorted the traits, so they are in the same order as the interfaces.
always makes it easier to track when its alphasorted - so thank you for that
| Category | Libraries | ⇒ | Repository Libraries |
| Category | Libraries Repository | ⇒ | Libraries |
Merging is blocked. Seems to be caused by line 64 in .github/workflows/create-translation-pull-request-v6.yml#L64, a gitignored file that was changed recently and where I missed that line and repaired in my fork. The diff for the force-push after the rebase changes that line to the current 6.2 version. I don't know what exactly went wrong, but hope you can easily solve this.
Sorted the traits, so they are in the same order as the interfaces.