? ? Failure

User tests: Successful: Unsuccessful:

avatar ggppdk
ggppdk
23 Jul 2018

Pull Request for Issue #19760

Summary of Changes

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

Testing Instructions

In Joomla Tags management

  1. Create a new tag:
    title: ocean
    alias: the-sea

  2. 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

Expected result

You can add tag or you get duplicate tag alias error or some other good feedback

Actual result

You get an SQL syntax error, without any indication of what happened

Documentation Changes Required

None

avatar ggppdk ggppdk - open - 23 Jul 2018
avatar ggppdk ggppdk - change - 23 Jul 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 23 Jul 2018
Category Libraries
avatar ggppdk ggppdk - change - 23 Jul 2018
The description was changed
avatar ggppdk ggppdk - edited - 23 Jul 2018
avatar ggppdk ggppdk - change - 23 Jul 2018
The description was changed
avatar ggppdk ggppdk - edited - 23 Jul 2018
avatar brianteeman
brianteeman - comment - 23 Jul 2018

So this kills the error message and lets you save the article but there is no indication that the tag was not created.

avatar ggppdk
ggppdk - comment - 23 Jul 2018

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

https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_tags/tables/tag.php#L91-L102

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

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 25 Jul 2018

i will make more commits for a more complete fix

@ggppdk does this mean not to test this Pull Request?

avatar ggppdk
ggppdk - comment - 25 Jul 2018

Yes, please wait

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 28 Apr 2019

@ggppdk whats the State of this Pull Request?

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 12 May 2019

I suggest to close this PR due the lack of response by @ggppdk. In the meantime i add the label "needs new owner".

avatar infograf768 infograf768 - change - 12 May 2019
Labels Added: ?
Removed: J3 Issue
avatar franz-wohlkoenig franz-wohlkoenig - change - 21 Jul 2019
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2019-07-21 05:05:00
Closed_By franz-wohlkoenig
avatar franz-wohlkoenig franz-wohlkoenig - close - 21 Jul 2019

Add a Comment

Login with GitHub to post a comment