J3 Issue ?
avatar AndyGaskell
AndyGaskell
20 Jun 2019

Steps to reproduce the issue

  1. Edit an article, or create a new one via the "administrator", for example at section /administrator/index.php?option=com_content&view=article&layout=edit

  2. In the "Category" field, type, for example "abcdef"

Expected result

The search returns "Category not found"

Actual result

The search returns "Add new Category", text, which is not clickable, so this text does not make sense as a call to action.

screen shot 2019-06-20 at 15 25 08

Additional comments

Looking in the language file, for example "en-GB.ini" you can see it says...
JGLOBAL_ADD_CUSTOM_CATEGORY="Add new Category"
...which suggests this was designed to have a feature enabling users to add new category. I had a look at the Chosen Java Script plug-in to see if there was an "add" feature or option, but could not find one, reading...
https://github.com/julesjanssen/chosen/
...and...
https://julesjanssen.github.io/chosen/

Finding the logic for this in...
https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_categories/models/fields/categoryedit.php
...and looking through the history I can't really see a place where the "Add new Category" was an link, or associated with an action.

The simple fix, I guess, would be to change...
JGLOBAL_ADD_CUSTOM_CATEGORY="Add new Category"
...to...
JGLOBAL_ADD_CUSTOM_CATEGORY="Category not found"

However it would make more sense to change it to...
JGLOBAL_CATEGORY_NOT_FOUND="Category not found"
...and also change the value in...
administrator/components/com_categories/models/fields/categoryedit.php
...from...
. 'data-no_results_text="' . JText::_('JGLOBAL_ADD_CUSTOM_CATEGORY') . '" '
...to...
. 'data-no_results_text="' . JText::_('JGLOBAL_CATEGORY_NOT_FOUND') . '" '
...I could only find one use of JGLOBAL_ADD_CUSTOM_CATEGORY in the code.

I'm happy to do this change and make a pull request if people think this is a fair solution.

System information (as much as possible)

Database Type | mysql
Database Version | 10.2.25-MariaDB
Database Collation | latin1_swedish_ci
Database Connection Collation | utf8mb4_general_ci
PHP Version | 7.2.19
Web Server | LiteSpeed
WebServer to PHP Interface | litespeed
Joomla! Version | Joomla! 3.9.6 Stable [ Amani ] 7-May-2019 15:00 GMT
Joomla! Platform Version | Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent | Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0```

Votes

# of Users Experiencing Issue
0/1
Average Importance Score
1.00

avatar AndyGaskell AndyGaskell - open - 20 Jun 2019
avatar joomla-cms-bot joomla-cms-bot - labeled - 20 Jun 2019
avatar AndyGaskell AndyGaskell - change - 20 Jun 2019
The description was changed
avatar AndyGaskell AndyGaskell - edited - 20 Jun 2019
avatar AndyGaskell
AndyGaskell - comment - 20 Jun 2019

fix formatting


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25283.

avatar AndyGaskell
AndyGaskell - comment - 20 Jun 2019

Quick links to code...

The code...
. 'data-no_results_text="' . JText::_('JGLOBAL_ADD_CUSTOM_CATEGORY') . '" '
...is at...
https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_categories/models/fields/categoryedit.php#L350

The code...
JGLOBAL_ADD_CUSTOM_CATEGORY="Add new Category"
...is at...
https://github.com/joomla/joomla-cms/blob/staging/administrator/language/en-GB/en-GB.ini#L266


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25283.

avatar AndyGaskell
AndyGaskell - comment - 20 Jun 2019

Quick links to code...

The code...
. 'data-no_results_text="' . JText::_('JGLOBAL_ADD_CUSTOM_CATEGORY') . '" '
...is at...
https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_categories/models/fields/categoryedit.php#L350

The code...
JGLOBAL_ADD_CUSTOM_CATEGORY="Add new Category"
...is at...
https://github.com/joomla/joomla-cms/blob/staging/administrator/language/en-GB/en-GB.ini#L266


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25283.

avatar franz-wohlkoenig franz-wohlkoenig - change - 20 Jun 2019
Labels Added: J3 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 20 Jun 2019
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 20 Jun 2019

can you please upgrade to latest Version?

avatar AndyGaskell
AndyGaskell - comment - 20 Jun 2019

Sorry, I've updated to the latest version and this is still the same.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25283.

avatar SharkyKZ
SharkyKZ - comment - 20 Jun 2019

You can create a new category by pressing Enter.

avatar AndyGaskell
AndyGaskell - comment - 20 Jun 2019

I also tested on 3 different systems and it is also the same.

PHP Built On 	Linux li276-89 4.18.8-x86_64-linode117 #1 SMP PREEMPT Tue Sep 18 18:48:25 UTC 2018 x86_64
Database Type 	mysql
Database Version 	5.5.62-0ubuntu0.14.04.1
Database Collation 	utf8_general_ci
Database Connection Collation 	utf8mb4_general_ci
PHP Version 	5.6.37-1+ubuntu14.04.1+deb.sury.org+1
Web Server 	Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f
WebServer to PHP Interface 	apache2handler
Joomla! Version 	Joomla! 3.9.8 Stable [ Amani ] 11-June-2019 20:00 GMT
Joomla! Platform Version 	Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent 	Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0

PHP Built On 	Linux uk605.directrouter.com 2.6.32-954.3.5.lve1.4.61.el6.x86_64 #1 SMP Thu Mar 14 07:14:46 EDT 2019 x86_64
Database Type 	mysql
Database Version 	10.2.25-MariaDB
Database Collation 	latin1_swedish_ci
Database Connection Collation 	utf8mb4_general_ci
PHP Version 	7.2.19
Web Server 	LiteSpeed
WebServer to PHP Interface 	litespeed
Joomla! Version 	Joomla! 3.9.8 Stable [ Amani ] 11-June-2019 20:00 GMT
Joomla! Platform Version 	Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent 	Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0
PHP Built On 	Linux piota002.directrouter.com 3.10.0-957.5.1.el7.x86_64 #1 SMP Fri Feb 1 14:54:57 UTC 2019 x86_64
Database Type 	mysql
Database Version 	5.5.5-10.2.25-MariaDB
Database Collation 	latin1_swedish_ci
Database Connection Collation 	utf8mb4_general_ci
PHP Version 	7.2.19
Web Server 	Apache
WebServer to PHP Interface 	cgi-fcgi
Joomla! Version 	Joomla! 3.9.8 Stable [ Amani ] 11-June-2019 20:00 GMT
Joomla! Platform Version 	Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent 	Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0
avatar AndyGaskell
AndyGaskell - comment - 20 Jun 2019

@SharkyKZ I didn't realise that, thanks :)

Maybe we could change it to...
JGLOBAL_ADD_CUSTOM_CATEGORY="Add new Category, type and hit enter"
...or something similar, to make this clearer and more intuitive.

I've been using Joomla for over 10 years, and would not have guesses this was the design pattern

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 20 Jun 2019

JGLOBAL_ADD_CUSTOM_CATEGORY="Add new Category, type and hit enter"

@brianteeman do you have a comment on this?

avatar franz-wohlkoenig franz-wohlkoenig - change - 20 Jun 2019
Status New Discussion
avatar AndyGaskell
AndyGaskell - comment - 20 Jun 2019

It's an awesome feature really, wish I'd know about it sooner :)

avatar AndyGaskell
AndyGaskell - comment - 20 Jun 2019

Perhaps...
JGLOBAL_ADD_CUSTOM_CATEGORY="To add the new Category %s hit enter"
...which would be, like...
"To add the new Category abcde hit enter"
...or...
JGLOBAL_ADD_CUSTOM_CATEGORY="Hit enter to add the new Category"
which would be, like...
"Hit enter to add the new Category abcde"
...would be nicer wording.

avatar AndyGaskell
AndyGaskell - comment - 20 Jun 2019

I suppose the UI element...
com_menus__item_pick_or_create
...in com_menus/item has a very similar context of use, but very different implementation.

Just a thought I had while looking for analogous UI elements in other parts of Joomla.

avatar franz-wohlkoenig franz-wohlkoenig - change - 21 Jun 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-06-21 04:05:34
Closed_By franz-wohlkoenig
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 21 Jun 2019

If People don't understand "Add new Category" and how to handle we get much more Issues. Closing this for that Reason; please reopen if further Discussion is needed.

avatar franz-wohlkoenig franz-wohlkoenig - close - 21 Jun 2019
avatar AndyGaskell
AndyGaskell - comment - 21 Jun 2019

Thanks for you time, thoughts and input on this @franz-wohlkoenig and @SharkyKZ ?

Happy for this to be closed, it's a v minor UI issue really, and perhaps a PICNIC issue anyway (problem in chair not in computer).

Personally I think, having considered it a while, that changing it to...
JGLOBAL_ADD_CUSTOM_CATEGORY="Hit enter to add the new Category"
...would be an improvement, but I am very happy to accept that this is not a commonly held view.

Add a Comment

Login with GitHub to post a comment