User tests: Successful: 0 Unsuccessful: 0
PR fixes Issue in joomla-framework/database#326
Forward compatibility PR to use DatabaseAwareTrait which allows us to set a database driver which implements only the DatabaseInterface
and does not need to extend the DatabaseDriver
.
This pr introduces setDatabase()
and getDatabase()
in a b/c way until the _db
variable and setDbo()
and getDbo()
gets removed.
@alexandreelise please test this pr for your use case and mark it as success if it fixes your issue.
Use Joomla, use any 3rd party extension which uses the Table class.
Works
Works
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org: TBD
No documentation changes for manual.joomla.org needed
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
You don't need to wait, just please test it.
Labels |
Added:
PR-5.4-dev
|
You don't need to wait, just please test it.
Tested successfully
It works even with a driver different than the one of the main database.
In this case I tried mysql
driver for the external database which is used for PDO Driver (but PDODriver is an abstract class) and the main joomla database untouched from your pr is using mysqli
driver
Here is a screenshot of data fetched from external database using an Table instantiated via anonymous class with injected external DatabaseInterface compatible from DatabaseFactory getDriver method.
Hey @HLeithner #45165 (comment) Tested successfully. Enjoy your weekend Super Joomlers.
@alexandreelise Can you open https://issues.joomla.org/tracker/joomla-cms/45165 and
Login with your github-account and
Now the test count as successfull.
I have tested this item ✅ successfully on 0743884
Please refer to https://issues.joomla.org/tracker/joomla-cms/45165#event-815648
Thanks @fgsw . Done. Enjoy your weekend.
@alexandreelise The PR has received a change. Could you test again? Just a quick check if it still works would be sufficient. Thanks in advance.
@richard67 Tested it and seems to still work as expected if I didn't do a mistake will testing. For me it still works fine just as the previous screenshot I showed.
I have tested this item ✅ successfully on d91c66d
@alexandreelise Sorry to bother you again, but the PR has again received changes. But I think now it's ready. Could you test again with the latest version and if ok, submit your test result with the issue tracker? Thanks in advance.
I have tested this item ✅ successfully on 6cdbf1b
@richard67 Still working as expected. Same outcome than before.
I have tested this item ✅ successfully on 6cdbf1b
@richard67 Still working as expected. Same outcome than before.
@richard67 Hey Richard, test done again with new changes. Seems to still work as expected. Same outcome. Tested successfully.
Status | Pending | ⇒ | Ready to Commit |
RTC
When a developer does setup a database in the constructor and assigns it with "$this->_db" then we have a difference here which might lead to unintended divergence. This should be handled somehow, that's why I used magic methods in #37095.
That's the reason I don't use databaseAwareTraitDatabase
write only. databaseAwareTraitDatabase
also can't be read by any child class. It's only set for documentation purpose.
The reason I didn't use the magic function is, that if someone uses this on it's own, we would have the same issue again. Using the _db
until we remove it, seems to be the better way for me.
Labels |
Added:
Feature
RTC
|
I guess this is fine here. The hard bc break comes, when $this->_db get removed.
@HLeithner might be useful. Unfortunately I use my PR in production already. Cannot afford to wait for Joomla to catch up and wait for Joomla 5.4. Nice work keep on your good work.