32
1
mirror of https://github.com/joomla-extensions/weblinks.git synced 2025-01-26 22:08:27 +00:00

Merge pull request #1 from alikon/patch-6

fix for postgresql
This commit is contained in:
Tuan Pham Ngoc 2021-06-27 19:34:13 +07:00 committed by GitHub
commit e7c0beed89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,6 +90,11 @@ class WeblinkTable extends Table implements VersionableTableInterface, TaggableT
{
$this->created_by = $user->id;
}
if (empty($this->hits))
{
$this->hits = 0;
}
}
// Set publish_up to null date if not set
@ -107,7 +112,7 @@ class WeblinkTable extends Table implements VersionableTableInterface, TaggableT
// Verify that the alias is unique
$table = new WeblinkTable($this->getDbo());
if ($table->load(array('language' => $this->language, 'alias' => $this->alias, 'catid' => $this->catid))
if ($table->load(array('language' => $this->language, 'alias' => $this->alias, 'catid' => (int)$this->catid))
&& ($table->id != $this->id || $this->id == 0))
{
$this->setError(Text::_('COM_WEBLINKS_ERROR_UNIQUE_ALIAS'));