Use correct database (#391)

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.
This commit is contained in:
Elijah Madden 2019-03-15 21:24:27 +09:00 committed by George Wilson
parent 8574a4f3cf
commit 802cff4ae8
1 changed files with 1 additions and 1 deletions

View File

@ -91,7 +91,7 @@ class WeblinksTableWeblink extends JTable
}
// Verify that the alias is unique
$table = JTable::getInstance('Weblink', 'WeblinksTable');
$table = JTable::getInstance('Weblink', 'WeblinksTable', array('dbo' => $this->getDbo()));
if ($table->load(array('language' => $this->language, 'alias' => $this->alias, 'catid' => $this->catid)) && ($table->id != $this->id || $this->id == 0))
{