Skip to content

Commit 7cb694d

Browse files
authored
[4.3] Revert 38576 (#40060)
1 parent a0c4649 commit 7cb694d

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

administrator/components/com_tags/src/Table/TagTable.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,10 @@ public function store($updateNulls = true)
191191
// Verify that the alias is unique
192192
$table = new static($this->getDbo());
193193

194-
if (
195-
$table->load(['alias' => $this->alias, 'parent_id' => (int) $this->parent_id])
196-
&& ($table->id != $this->id || $this->id == 0)
197-
) {
198-
// Is the existing tag trashed?
194+
if ($table->load(['alias' => $this->alias]) && ($table->id != $this->id || $this->id == 0)) {
199195
$this->setError(Text::_('COM_TAGS_ERROR_UNIQUE_ALIAS'));
200196

197+
// Is the existing tag trashed?
201198
if ($table->published === -2) {
202199
$this->setError(Text::_('COM_TAGS_ERROR_UNIQUE_ALIAS_TRASHED'));
203200
}

administrator/language/en-GB/com_tags.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ COM_TAGS_COUNT_UNPUBLISHED_ITEMS="Unpublished items"
3737
COM_TAGS_EMPTYSTATE_BUTTON_ADD="Add your first tag"
3838
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."
3939
COM_TAGS_EMPTYSTATE_TITLE="No Tags have been created yet."
40-
COM_TAGS_ERROR_UNIQUE_ALIAS="Another Tag with the same parent tag has the same alias."
40+
COM_TAGS_ERROR_UNIQUE_ALIAS="Another Tag has the same alias (remember it may be a trashed item)."
4141
COM_TAGS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Tag with the same parent tag has the same alias."
4242
COM_TAGS_EXCLUDE="Exclude"
4343
COM_TAGS_FIELD_CONTENT_TYPE_LABEL="Content types"

libraries/src/Table/ContentType.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,7 @@ public function store($updateNulls = false)
8181
// Verify that the alias is unique
8282
$table = Table::getInstance('Contenttype', 'JTable', ['dbo' => $this->getDbo()]);
8383

84-
if (
85-
$table->load(['alias' => $this->alias, 'parent_id' => (int) $this->parent_id])
86-
&& ($table->id != $this->id || $this->id == 0)
87-
) {
84+
if ($table->load(['type_alias' => $this->type_alias]) && ($table->type_id != $this->type_id || $this->type_id == 0)) {
8885
$this->setError(Text::_('COM_TAGS_ERROR_UNIQUE_ALIAS'));
8986

9087
return false;

0 commit comments

Comments
 (0)