-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Fix: Banner clients accept duplicates #46239
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
base: 5.4-dev
Are you sure you want to change the base?
Changes from 2 commits
7c30a27
abe0c7b
08b459a
cd493a0
cccf92d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -14,6 +14,7 @@ | |||||||||||||||||||||||||||||||||||||||||||||
| use Joomla\CMS\MVC\Model\AdminModel; | ||||||||||||||||||||||||||||||||||||||||||||||
| use Joomla\CMS\Table\Table; | ||||||||||||||||||||||||||||||||||||||||||||||
| use Joomla\CMS\Versioning\VersionableModelTrait; | ||||||||||||||||||||||||||||||||||||||||||||||
| use Joomla\CMS\Language\Text; | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| // phpcs:disable PSR1.Files.SideEffects | ||||||||||||||||||||||||||||||||||||||||||||||
| \defined('_JEXEC') or die; | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -135,4 +136,58 @@ protected function prepareTable($table) | |||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| $table->name = htmlspecialchars_decode($table->name, ENT_QUOTES); | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||||||||
| * Override save to prevent duplicate client names when saving as copy. | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
| /** | |
| * Override save to prevent duplicate client names when saving as copy. | |
| /** | |
| * Override save to prevent duplicate client names when saving as copy. |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * @since 5.3.5 | |
| * @since __DEPLOY_VERSION__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /** | |
| * Generate a unique client name if it already exists. | |
| * | |
| * @param string $name The original client name | |
| * | |
| * @return string Unique client name | |
| */ | |
| protected function generateUniqueName($name) | |
| /** | |
| * Generate a unique client name if it already exists. | |
| * | |
| * @param string $name The original client name | |
| * | |
| * @return string Unique client name | |
| * @since __DEPLOY_VERSION__ | |
| */ | |
| protected function generateUniqueName($name) |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the 4 empty lines 189 to 192.
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -202,5 +202,7 @@ COM_BANNERS_TYPE2="Clicks" | |||
| COM_BANNERS_UNLIMITED="Unlimited" | ||||
| COM_BANNERS_WARNING_PROVIDE_VALID_NAME="Please provide a valid, non-blank name" | ||||
| COM_BANNERS_XML_DESCRIPTION="This component manages banners and banner clients." | ||||
| COM_BANNERS_CLIENT_ERROR_DUPLICATE_NAME="A client with this name already exists." | ||||
|
||||
|
|
||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Remove redundant empty line. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the review, @richard67! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Language key should be in alpha order. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the review @QuyTon! |
||||
|
|
||||
| JLIB_RULES_SETTING_NOTES_COM_BANNERS="Changes apply to this component only.<br><em><strong>Inherited</strong></em> - a Global Configuration setting or higher level setting is applied.<br><em><strong>Denied</strong></em> always wins - whatever is set at the Global or higher level and applies to all child elements.<br><em><strong>Allowed</strong></em> will enable the action for this component unless overruled by a Global Configuration setting." ; Alternate language strings for the rules form field | ||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sort alpha order.