joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.79k stars 3.65k forks source link

[4.0] Tag selection in Category Blog menu item broken #24472

Closed stutteringp0et closed 5 years ago

stutteringp0et commented 5 years ago

Steps to reproduce the issue

You must have one or more articles with tags

Create a new menu item of type "Category Blog" Select a category Attempt to select a tag

Expected result

Can select one or more tags

Actual result

upon clicking a tag, this error occurs in the javascript console:

Uncaught TypeError: e.replace is not a function at t.stripHTML (choices.min.js?3.0.4:4) at Object.addItemText (choices.min.js?3.0.4:2) at e.value (choices.min.js?3.0.4:2) at e.value (choices.min.js?3.0.4:2) at e.value (choices.min.js?3.0.4:2)

System information (as much as possible)

Joomla! 4.0.0-alpha8-dev Development [ Amani ] 9-March-2019 13:41 GMT

Additional comments

ghost commented 5 years ago

Thanks for your Report. I guess its a duplicate of #23589. I tested your Steps to reproduce and get similaer issues "No results match" on Articles, Menues. So i will change the Title of #23589 and link to this Issue. If this is fine for you, please close this Issue.

stutteringp0et commented 5 years ago

I can get results, I just can't click on any of them - I get the JS error image

ghost commented 5 years ago

so can you give more Informations like Browser, OS, ...

System information

Setting Value
PHP Built On Linux lamp122.cloudaccess.net 3.10.0-962.3.2.lve1.5.24.7.el6h.x86_64 nr.1 SMP Mon Dec 17 12:02:35 EST 2018 x86_64
Database Type mysql
Database Version 5.7.24-cll-lve
Database Collation utf8_general_ci
Database Connection Collation utf8_general_ci
PHP Version 7.1.26
Web Server Apache
WebServer to PHP Interface cgi-fcgi
Joomla! Version Latest Nightly Build Update from Joomla! 4.0.0-alpha8-dev Development [ Amani ] 9-March-2019 13:41 GMT
User Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:66.0) Gecko/20100101 Firefox/66.0
stutteringp0et commented 5 years ago

============= System Information

php: Linux deathticle 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64 dbserver: mysql dbversion: 5.5.5-10.2.16-MariaDB-10.2.16+maria~artful dbcollation: utf8mb4_general_ci dbconnectioncollation: utf8_general_ci phpversion: 7.2.15-0ubuntu0.18.04.2 server: nginx/1.14.0 sapi_name: fpm-fcgi version: Joomla! 4.0.0-alpha8-dev Development [ Amani ] 9-March-2019 13:41 GMT useragent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/73.0.3683.75 Chrome/73.0.3683.75 Safari/537.36

ghazal commented 5 years ago

Already discussed in #24211

We are using the script choices.js and its joomla adapted dependant script, joomla-field-fancy-select.js The error lies in an old version of choices.js. It's been corrected in an ulterior version, not yet implemented in j4. But if we use choices.js last version, the joomla adapted dependant script, joomla-field-fancy-select.js is not really functional. Until this script is corrected, we won't be able to use this functionality.

As is, it's possible to make it work in a fashion, in /media/vendor/choicesjs/js/choices.js (v.3.0.4): line 5920 replace

var stripHTML = exports.stripHTML = function stripHTML(html) {
      return html.replace(/&/g, '&amp;').replace(/>/g, '&rt;').replace(/</g, '&lt;').replace(/"/g, '&quot;');
    };

by

var stripHTML = exports.stripHTML = function stripHTML(html) {
      return String(html).replace(/&/g, '&amp;').replace(/>/g, '&rt;').replace(/</g, '&lt;').replace(/"/g, '&quot;');
    };

But this meddling won't stand future updates.

stutteringp0et commented 5 years ago

Fantastic! Thanks for the update, I'll close this issue.