diff --git a/administrator/components/com_tags/src/Table/TagTable.php b/administrator/components/com_tags/src/Table/TagTable.php index ec039287a02b8..825044c55bfbc 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 d2c361c4ad410..675fe3c6ae9bc 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 768aebbeced95..4747e1995f4cb 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;