-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tag alias #38576
tag alias #38576
Conversation
You should be able to create tags with parents and children such as - Sport -- adults -- children - games -- adults -- children Before this PR you could not as you would get a duplicate alias message error even though the tags have different parents and there is no reason that I can see to prevent this *_I may be very wrong as I dont use tags that often_*
I have tested this item ✅ successfully on 46f47fb This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38576. |
1 similar comment
I have tested this item ✅ successfully on 46f47fb This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38576. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38576. |
To be sure that there are no side effects we do not see, please move it to 4.3. Especially with your new tag feature this fix will have the chance to receive deeper tests. |
You already did ;( |
Thank you Brian @brianteeman |
Please be aware that this change means that routing is going to be broken for the duplicate aliases. The routing currently (and with my rewrite in #39114) simply takes the alias of the tag to identify the tag to load. I would propose to add a switch to either allow single level tags or to use nestable tags and change the routing in that case. |
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) | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brianteeman Are you sure this change is correct?. The alias
and parent_id
fields do not exist in #__content_types
table and I think using the lang key COM_TAGS_ERROR_UNIQUE_ALIAS
does not belong here and was wrong even before this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm currently testing the Joomla 4.3 Beta 4 with HikaShop. During the installation process, we use this store function to add the tags capability on the products from HikaShop. We get the error:
Missing field in database: Joomla\CMS\Table\ContentType alias.
https://i.imgur.com/yRGq5wK.png
Reverting this change does fix the problem. But I'm not familiar enough with the tag system to know if the code change is ok and we should change something in HikaShop (but what ?) or if another kind of modification should be necessary in Joomla 4.3 to fix the tag alias issue while preventing this error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes this PR is wrong
You should be able to create tags with parents and children such as
-- adults
-- children
-- adults
-- children
Before this PR you could not as you would get a duplicate alias message error even though the tags have different parents and there is no reason that I can see to prevent this I may be very wrong as I dont use tags that often
Pull Request for Issue #21326 .