Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: 5.3-dev
Choose a base branch
from

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants