Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions administrator/components/com_banners/src/Table/BannerTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,15 @@ public function store($updateNulls = true)
{
$db = $this->getDbo();

// Verify that the alias is unique
$table = new self($db, $this->getDispatcher());

if ($table->load(['alias' => $this->alias, 'catid' => $this->catid]) && ($table->id != $this->id || $this->id == 0)) {
$this->setError(Text::_('COM_BANNERS_ERROR_UNIQUE_ALIAS'));

return false;
}

if (empty($this->id)) {
$purchaseType = $this->purchase_type;

Expand Down Expand Up @@ -261,15 +270,6 @@ public function store($updateNulls = true)
$this->setError($oldrow->getError());
}

// Verify that the alias is unique
$table = new self($db, $this->getDispatcher());

if ($table->load(['alias' => $this->alias, 'catid' => $this->catid]) && ($table->id != $this->id || $this->id == 0)) {
$this->setError(Text::_('COM_BANNERS_ERROR_UNIQUE_ALIAS'));

return false;
}

// Store the new row
parent::store($updateNulls);

Expand Down
Loading