Failure

User tests: Successful: Unsuccessful:

avatar okonomiyaki3000
okonomiyaki3000
19 Sep 2018

Suppose you're not operating on the default Joomla database (the one returned by JFactory::getDbo()) but on another one entirely? In theory, it is possible. In that case, you will want this new table object to use the same DBO that $this is using.

If you look at any similar table classes that are built in to Joomla, you will see this same kind of thing. So this is consistent with Joomla practices.

Summary of Changes

Use the current table object's DBO when creating other table objects. Because we want them to operate on the same database. Which, it is possible, may be different from the Joomla default DBO.

Testing Instructions

This change is in the store function of the weblinks table class. So try storing some weblinks. In particular, this code is related to the enforcement of unique aliases. So try storing a weblink with an alias that hasn't been used before and try storing one with an alias that already exists and try saving one that has been saved already.

Expected result

Everything will continue to work exactly as it has before with no change whatsoever unless you are testing some custom action on a database other than your default one.

Actual result

I guess that, until now, it would have been possible to store weblinks on a different database with non-unique aliases because the code was only checking for uniqueness on the default db. It is also possible that you may have been denied storing on a different database if the default db contained a weblink with a similar alias even though no similar alias existed on the db you were actually trying to save to.

If these situations are hard to imagine, they are very non-standard and would never occur with typical usage of Joomla. Nevertheless, this change is an improvement and, in fact, a bugfix.

Documentation Changes Required

no.

avatar okonomiyaki3000 okonomiyaki3000 - open - 19 Sep 2018
avatar okonomiyaki3000
okonomiyaki3000 - comment - 19 Sep 2018

It shouldn't surprise anyone that Travis has failed. However, this PR is good. Travis is wrong.

avatar puneet0191
puneet0191 - comment - 19 Sep 2018

@okonomiyaki3000 Yeah travis seems to be broken, we will get this one reviewed and merge it. Thanks a lot for your contribution.

avatar wilsonge wilsonge - change - 15 Mar 2019
Status New Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-03-15 12:24:34
Closed_By wilsonge
avatar wilsonge wilsonge - close - 15 Mar 2019
avatar wilsonge wilsonge - merge - 15 Mar 2019
avatar wilsonge wilsonge - reference | 802cff4 - 15 Mar 19
avatar wilsonge wilsonge - merge - 15 Mar 2019
avatar wilsonge wilsonge - close - 15 Mar 2019
avatar okonomiyaki3000 okonomiyaki3000 - head_ref_deleted - 15 May 2019

Add a Comment

Login with GitHub to post a comment