Skip to content

tag alias #2610

@jgerman-bot

Description

@jgerman-bot

New language relevant PR in upstream repo: joomla/joomla-cms#38576 Here are the upstream changes:

Click to expand the diff!
diff --git a/administrator/components/com_tags/src/Table/TagTable.php b/administrator/components/com_tags/src/Table/TagTable.php
index ec039287a02b..825044c55bfb 100644
--- a/administrator/components/com_tags/src/Table/TagTable.php
+++ b/administrator/components/com_tags/src/Table/TagTable.php
@@ -190,8 +190,10 @@ public function store($updateNulls = true)
 
         // Verify that the alias is unique
         $table = new static($this->getDbo());
-
-        if ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0)) {
+        if (
+            $table->load(array('alias' => $this->alias, 'parent_id' => (int) $this->parent_id))
+            && ($table->id != $this->id || $this->id == 0)
+        ) {
             $this->setError(Text::_('COM_TAGS_ERROR_UNIQUE_ALIAS'));
 
             return false;
diff --git a/administrator/language/en-GB/com_tags.ini b/administrator/language/en-GB/com_tags.ini
index d2c361c4ad41..675fe3c6ae9b 100644
--- a/administrator/language/en-GB/com_tags.ini
+++ b/administrator/language/en-GB/com_tags.ini
@@ -37,7 +37,7 @@ COM_TAGS_COUNT_UNPUBLISHED_ITEMS="Unpublished items"
 COM_TAGS_EMPTYSTATE_BUTTON_ADD="Add your first tag"
 COM_TAGS_EMPTYSTATE_CONTENT="Tags in Joomla! provide a flexible way of organizing content. The same tag can be applied to many different content items across content types."
 COM_TAGS_EMPTYSTATE_TITLE="No Tags have been created yet."
-COM_TAGS_ERROR_UNIQUE_ALIAS="Another Tag has the same alias (remember it may be a trashed item)."
+COM_TAGS_ERROR_UNIQUE_ALIAS="Another Tag with the same parent tag has the same alias (remember it may be a trashed item)."
 COM_TAGS_EXCLUDE="Exclude"
 COM_TAGS_FIELD_CONTENT_TYPE_LABEL="Content types"
 COM_TAGS_FIELD_FULL_LABEL="Full Image"
diff --git a/libraries/src/Table/ContentType.php b/libraries/src/Table/ContentType.php
index 768aebbeced9..4747e1995f4c 100644
--- a/libraries/src/Table/ContentType.php
+++ b/libraries/src/Table/ContentType.php
@@ -81,7 +81,10 @@ public function store($updateNulls = false)
         // Verify that the alias is unique
         $table = Table::getInstance('Contenttype', 'JTable', array('dbo' => $this->getDbo()));
 
-        if ($table->load(array('type_alias' => $this->type_alias)) && ($table->type_id != $this->type_id || $this->type_id == 0)) {
+        if (
+            $table->load(array('alias' => $this->alias, 'parent_id' => (int) $this->parent_id))
+            && ($table->id != $this->id || $this->id == 0)
+        ) {
             $this->setError(Text::_('COM_TAGS_ERROR_UNIQUE_ALIAS'));
 
             return false;

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions