User tests: Successful: Unsuccessful:
Update code base from old to new sintax
Factory::getDbo
changed to Factory::getContainer()->get(DatabaseInterface::class)
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.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:
?
|
@sergeytolkachyov Could not say that I understand these container stuffs, however, base on what I see from core code and by reading comments from maintainers on other similar PRs in the past, you should use
Factory::getContainer()->get(DatabaseInterface::class)
instead of usingFactory::getContainer()->get('DatabaseDriver')
as how you are doing here. See https://github.com/joomla/joomla-cms/blob/4.2-dev/modules/mod_finder/src/Helper/FinderHelper.php#L82 for an example
Thank you, I changed it
I have tested this item
Both code review and run some code to test the methods which are affected by this change.
If someone wants to do real test, add this line of code below to index.php file of your template, then access to backend and see data for the phpass lib displayed:
$lib = \Joomla\CMS\Helper\LibraryHelper::getLibrary('phpass');
var_dump($lib);
I also tested saveParams method, too. So maybe you just need to do a code review should be enough.
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC this time with the issue tracker.
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-02-23 13:53:53 |
Closed_By | ⇒ | laoneo |
Thanks!
@sergeytolkachyov Could not say that I understand these container stuffs, however, base on what I see from core code and by reading comments from maintainers on other similar PRs in the past, you should use
Factory::getContainer()->get(DatabaseInterface::class)
instead of usingFactory::getContainer()->get('DatabaseDriver')
as how you are doing here. See https://github.com/joomla/joomla-cms/blob/4.2-dev/modules/mod_finder/src/Helper/FinderHelper.php#L82 for an example