User tests: Successful: Unsuccessful:
Move from using JFactory::getDatabase()
to the internal JModelLegacy
method to allow the JDatabase
object to be injected if desired.
The model allows injection of the database object via the config parameter in it's constructor. However it means you must use the getDbo()
function instead of using JFactory
. Note this is completely b/c with all previous implementations and indeed getDbo()
is used in other parts of the component (e.g. https://github.com/wilsonge/weblinks/blob/patch-1/src/com_weblinks/admin/models/weblinks.php#L124)
To test ensure that saving any new or existing weblink continues to work perfectly
This is part of a PR to the CMS at joomla/joomla-cms#4992 doing the same thing across all component models