mirror of
https://github.com/joomla-extensions/weblinks.git
synced 2025-02-11 21:58:37 +00:00
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:
parent
8574a4f3cf
commit
802cff4ae8
@ -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))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user