New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JFactory::getDbo() deprecated #601
Comments
I didn't test.
🎄🎄🎄 |
Thanks @trob Found a solution based on this https://github.com/joomla/joomla-cms/discussions/38111 escaping \ as you suggested. So the final one for calc element is: use Joomla\CMS\Factory; On a separate note I used the same in j4upgrade.php file provided by @skurvish and works fine. Thanks @skurvish for the file. Merry Christmas to everyone! |
Did you try |
@trob Just gave it a try. It works, but only if I disable Ajax. |
Just tested:
is working with Ajax calc, with and without Ajaxfied links. If you get a sticky spinner with Ajax calc check your browser's network response to see the error. You should have "use ..." at the beginning of our code (although I think it doesn't matter). |
Thanks for your efforts, @trob |
Before reporting an issue please check that it has not already been fixed by reviewing the changelog in the Wiki or other open issues that may be pending confirmation. Thank you.
To Reproduce
Changing depreacted code in calc element based on upgrading instruction to replace Factory::getDbo() to:
$db = version_compare(\Joomla\CMS\Version::MAJOR_VERSION, "4", ">=") ? Factory::getContainer()->get('DatabaseDriver') : Factory::getDbo();
Expected behavior
Removing notice:
Joomla\CMS\Factory::getDbo() is deprecated. Load the database from the dependency injection container.
Actual behavior
Error:
Class "JoomlaCMSVersion" not found
Screenshots
Additional context
Using J!4.2.5 with F4.0beta4b in a clean J!4+F4 test site.
The text was updated successfully, but these errors were encountered: