No Code Attached Yet bug
avatar brianteeman
brianteeman
6 Jun 2025

Steps to reproduce the issue

Create a banner called "test"
Try and create a second banner with the same name "test"

Expected result

The code suggests that it should not be possible to save the second banner as the alias is not unique

// 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;
}

Actual result

The banner is saved resulting in two banners in the same category with the same name and alias

Additional comments

Not even sure why banners have an alias at all

avatar brianteeman brianteeman - open - 6 Jun 2025
avatar joomla-cms-bot joomla-cms-bot - change - 6 Jun 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 6 Jun 2025
avatar chmst chmst - change - 9 Jun 2025
Labels Added: bug
avatar chmst chmst - labeled - 9 Jun 2025
avatar chmst
chmst - comment - 9 Jun 2025

The check is not made for new banners, only at update. This is a bug.

Questions are:

Not even sure why banners have an alias at all

Is it allowed to have two banners with the same name in a category? I think yes, if at least the clients are different, there is no check for clients

avatar richard67 richard67 - close - 12 Jun 2025
avatar richard67
richard67 - comment - 12 Jun 2025

Closing as having a pull request. Please test #45599 . Thanks in advance.

avatar richard67 richard67 - change - 12 Jun 2025
Status New Closed
Closed_Date 0000-00-00 00:00:00 2025-06-12 10:29:23
Closed_By richard67

Add a Comment

Login with GitHub to post a comment