Click to expand the diff!
```diff
diff --git a/administrator/components/com_tags/src/Table/TagTable.php b/administrator/components/com_tags/src/Table/TagTable.php
index 4cb40a89c5ca..ff77478d9b3c 100644
--- a/administrator/components/com_tags/src/Table/TagTable.php
+++ b/administrator/components/com_tags/src/Table/TagTable.php
@@ -191,13 +191,10 @@ public function store($updateNulls = true)
// Verify that the alias is unique
$table = new static($this->getDbo());
- if (
- $table->load(['alias' => $this->alias, 'parent_id' => (int) $this->parent_id])
- && ($table->id != $this->id || $this->id == 0)
- ) {
- // Is the existing tag trashed?
+ if ($table->load(['alias' => $this->alias]) && ($table->id != $this->id || $this->id == 0)) {
$this->setError(Text::_('COM_TAGS_ERROR_UNIQUE_ALIAS'));
+ // Is the existing tag trashed?
if ($table->published === -2) {
$this->setError(Text::_('COM_TAGS_ERROR_UNIQUE_ALIAS_TRASHED'));
}
diff --git a/administrator/language/en-GB/com_tags.ini b/administrator/language/en-GB/com_tags.ini
index 1e8cfac742ae..884c9672f59a 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 with the same parent tag has the same alias."
+COM_TAGS_ERROR_UNIQUE_ALIAS="Another Tag has the same alias (remember it may be a trashed item)."
COM_TAGS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Tag with the same parent tag has the same alias."
COM_TAGS_EXCLUDE="Exclude"
COM_TAGS_FIELD_CONTENT_TYPE_LABEL="Content types"
diff --git a/libraries/src/Table/ContentType.php b/libraries/src/Table/ContentType.php
index 1ca62675a5fb..e529a4f6863c 100644
--- a/libraries/src/Table/ContentType.php
+++ b/libraries/src/Table/ContentType.php
@@ -81,10 +81,7 @@ public function store($updateNulls = false)
// Verify that the alias is unique
$table = Table::getInstance('Contenttype', 'JTable', ['dbo' => $this->getDbo()]);
- if (
- $table->load(['alias' => $this->alias, 'parent_id' => (int) $this->parent_id])
- && ($table->id != $this->id || $this->id == 0)
- ) {
+ if ($table->load(['type_alias' => $this->type_alias]) && ($table->type_id != $this->type_id || $this->type_id == 0)) {
$this->setError(Text::_('COM_TAGS_ERROR_UNIQUE_ALIAS'));
return false;
```
PR w związku ze zmianą oryginału https://github.com/joomla/joomla-cms/pull/40060 Poniżej zmiany w oryginale:
Click to expand the diff!
```diff diff --git a/administrator/components/com_tags/src/Table/TagTable.php b/administrator/components/com_tags/src/Table/TagTable.php index 4cb40a89c5ca..ff77478d9b3c 100644 --- a/administrator/components/com_tags/src/Table/TagTable.php +++ b/administrator/components/com_tags/src/Table/TagTable.php @@ -191,13 +191,10 @@ public function store($updateNulls = true) // Verify that the alias is unique $table = new static($this->getDbo()); - if ( - $table->load(['alias' => $this->alias, 'parent_id' => (int) $this->parent_id]) - && ($table->id != $this->id || $this->id == 0) - ) { - // Is the existing tag trashed? + if ($table->load(['alias' => $this->alias]) && ($table->id != $this->id || $this->id == 0)) { $this->setError(Text::_('COM_TAGS_ERROR_UNIQUE_ALIAS')); + // Is the existing tag trashed? if ($table->published === -2) { $this->setError(Text::_('COM_TAGS_ERROR_UNIQUE_ALIAS_TRASHED')); } diff --git a/administrator/language/en-GB/com_tags.ini b/administrator/language/en-GB/com_tags.ini index 1e8cfac742ae..884c9672f59a 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 with the same parent tag has the same alias." +COM_TAGS_ERROR_UNIQUE_ALIAS="Another Tag has the same alias (remember it may be a trashed item)." COM_TAGS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Tag with the same parent tag has the same alias." COM_TAGS_EXCLUDE="Exclude" COM_TAGS_FIELD_CONTENT_TYPE_LABEL="Content types" diff --git a/libraries/src/Table/ContentType.php b/libraries/src/Table/ContentType.php index 1ca62675a5fb..e529a4f6863c 100644 --- a/libraries/src/Table/ContentType.php +++ b/libraries/src/Table/ContentType.php @@ -81,10 +81,7 @@ public function store($updateNulls = false) // Verify that the alias is unique $table = Table::getInstance('Contenttype', 'JTable', ['dbo' => $this->getDbo()]); - if ( - $table->load(['alias' => $this->alias, 'parent_id' => (int) $this->parent_id]) - && ($table->id != $this->id || $this->id == 0) - ) { + if ($table->load(['type_alias' => $this->type_alias]) && ($table->type_id != $this->type_id || $this->type_id == 0)) { $this->setError(Text::_('COM_TAGS_ERROR_UNIQUE_ALIAS')); return false; ```