Skip to content

[5.3] Banners - Enforce Unique Alias on Both Create and Update#45599

Merged
rdeutz merged 8 commits intojoomla:5.3-devfrom
travisrisner:banner-alias-fix
Aug 25, 2025
Merged

[5.3] Banners - Enforce Unique Alias on Both Create and Update#45599
rdeutz merged 8 commits intojoomla:5.3-devfrom
travisrisner:banner-alias-fix

Conversation

@travisrisner
Copy link
Contributor

Pull Request for Issue #45570

Summary of Changes

This PR fixes an issue where Joomla allows the creation of multiple banners with the same alias within the same category, despite the code intending to enforce alias uniqueness.

Previously, the alias uniqueness check existed only within the update functionality of the store function in the BannerTable class, meaning it was bypassed during insert operations. This PR moves the uniqueness validation outside of the update logic so that it runs consistently during both insert and update operations.

I agree with Brian's comment on the initial issue though, I'm not fully sure what the alias is actually used for.

Testing Instructions

  1. In the Joomla administrator, go to Components → Banners.
  2. Create a new banner and name it "test".
  3. Try to create a second banner also named "test" in the same category.

Actual result BEFORE applying this Pull Request

  • Both banners are saved, resulting in two entries with the same alias in the same category.

Expected result AFTER applying this Pull Request

  • Saving the second banner fails with an error.
  • Only one banner with a specific alias per category is allowed.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@richard67 richard67 added the bug label Jun 12, 2025
@richard67 richard67 mentioned this pull request Jun 12, 2025
@chmst
Copy link
Contributor

chmst commented Jun 12, 2025

I am wondering if it makes sense to have the same banner (name and alias) for different clients?

@travisrisner
Copy link
Contributor Author

I am wondering if it makes sense to have the same banner (name and alias) for different clients?

That's a good question, and I'm really not sure. It doesn't appear there's anything from stopping 2 banners from having the same name.

As far as the alias, I'm really not sure that the alias is actually used for anything. I can't find anything it's used for on the component or the banner module, but it could be something someone added as a plan for the future? I tested out the links it generates for tracking clicks and none of that uses an alias it seems at the moment, it's all pretty much ID based.

@exlemor
Copy link

exlemor commented Aug 1, 2025

I have tested this item ✅ successfully on f6a6f8d

I was able to test this successfully! Thanks @travisrisner.

(I admit never having used banners in over a 100 sites 😱 lol but I hear quite a few people do, so I think they'll appreciate the fix :) )


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45599.

@exlemor exlemor added the PBF Pizza, Bugs and Fun label Aug 23, 2025
@SumCompanyInc
Copy link

I have tested this item ✅ successfully on f6a6f8d

works for me!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45599.

@richard67
Copy link
Member

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45599.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Aug 23, 2025
@rdeutz rdeutz enabled auto-merge (squash) August 25, 2025 11:57
@rdeutz
Copy link
Contributor

rdeutz commented Aug 25, 2025

Thanks

@rdeutz rdeutz merged commit 62a22cc into joomla:5.3-dev Aug 25, 2025
39 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Aug 25, 2025
@richard67 richard67 added this to the Joomla! 5.3.4 milestone Aug 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug PBF Pizza, Bugs and Fun

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants