In Joomla Tags management
Create a new tag:
title: ocean
alias: the-sea
In article form try to add (and then save the form) a tag that causes duplicate alias, try to add a new tag titled:
the sea
NOTE: the article must not have any other tags just try to add a single tag, the above one
You can add tag or you get duplicate tag alias error or some other good feedback
You get an SQL syntax error, without any indication of what happened
Souce code doing the above is
Duplicate alias is found here
https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Helper/TagsHelper.php#L260
then here you get a zero size array
https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Helper/TagsHelper.php#L71
then here you get an empty SQL clause
https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Helper/TagsHelper.php#L90
This is not a security issue, just an empty SQL clause, making an SQL syntax error, so i report it here
Besides the SQL syntax error
TagsHelper::addTagMapping
also has a really unhelpful return value
it does not return information to the caller of which tags were really created / mapped
it is almost a black box, if we can at least do something in B/C way , e.g. pass by reference an array that is populated with the tags that were successfully added it can become much more useful, also making possible to return error information
Labels |
Added:
?
|
Title |
|
Category | ⇒ | com_tags |
Labels |
Added:
J3 Issue
|
Status | New | ⇒ | Discussion |
Can this get a more complete solution like what i am asking in additional comments above ?
If someone writes the code then yes
I am now using a custom TagsHelper and method that also includes some feedback why the tags were not created
but at least the SQL error can be fixed with this PR: #21239 allowing the form to be saved
about feedback to the user, it can be in some other PR if someone is interested
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-07-23 20:08:01 |
Closed_By | ⇒ | ggppdk |
Please don't make a PR to just return true or false inside TagsHelper::addTagMapping, just for fixing the SQL syntax error.
Can this get a more complete solution like what i am asking in additional comments above ?