Skip to content

Commit

Permalink
[4.3] Revert 38576 (#40060)
Browse files Browse the repository at this point in the history
  • Loading branch information
joomdonation authored Mar 11, 2023
1 parent a0c4649 commit 7cb694d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
7 changes: 2 additions & 5 deletions administrator/components/com_tags/src/Table/TagTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/com_tags.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 1 addition & 4 deletions libraries/src/Table/ContentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7cb694d

Please sign in to comment.