User tests: Successful: Unsuccessful:
Pull Request for Issue #19760
TagsHelper::addTagMapping() may try to insert zero tag mappings to DB table
#__contentitem_tag_map
causing an unhelpful SQL , and record form saving to fail
We may as well return true, and just not try to insert zero mappings
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
None
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
So this kills the error message and lets you save the article but there is no indication that the tag was not created.
Exactly
Also i see that unlikely Tables for other records the
check() method of Tags does not check for duplicate alias, like it is done in other tables
e.g. the check() for Fields here will return an error and set an error, if calculated alias is already in use:
https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_fields/tables/field.php#L111-L116
Setting such an error in the Tags table would make a lot of sense ... if we are inside that Tags Edit From
if tag is created via the record form of some component
e.g. via article form then the user is not able to set the tag aliases only the tag titles,
but at least it would be good feedback instead of the SQL Error
i will make more commits for a more complete fix
Yes, please wait
Labels |
Added:
?
Removed: J3 Issue |
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-07-21 05:05:00 |
Closed_By | ⇒ | franz-wohlkoenig |
So this kills the error message and lets you save the article but there is no indication that the tag was not created.