?
avatar PhilETaylor
PhilETaylor
20 Apr 2021

Steps to reproduce the issue

Install Joomla 4
Enable Debug Language in Global Config
Navigate to add a new article
see javascript console on the Edit Article Page

Expected result

No JS console errors.

Actual result

SyntaxError: The string did not match the expected pattern.

Screenshot 2021-04-20 at 22 23 34

System information (as much as possible)

safari on mac, but probably unrelated.

Additional comments

// @dgrammatiko ?

avatar PhilETaylor PhilETaylor - open - 20 Apr 2021
avatar joomla-cms-bot joomla-cms-bot - change - 20 Apr 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 20 Apr 2021
avatar infograf768
infograf768 - comment - 21 Apr 2021

Confirmed for all Browsers, below for Firefox.

 Uncaught DOMException: Document.querySelectorAll: '#jform_articletext_**Article**Modal' is not a valid selector modal.min.js:1
    <anonymous> http://localhost:8888/sample/joomla40/media/vendor/bootstrap/js/modal.min.js?5.0.0-beta2:1
    forEach self-hosted:206
    <anonymous> http://localhost:8888/sample/joomla40/media/vendor/bootstrap/js/modal.min.js?5.0.0-beta2:1
    InnerModuleEvaluation self-hosted:2379
    evaluation self-hosted:2330

all xtd broken

code produced is
<div id="jform_articletext_**Article**Modal" role="dialog" tabindex="-1" class="joomla-modal modal fade" data-url="http://localhost:8888/sample/joomla40/administrator/index.php?option=com_content&amp;view=articles&amp;layout=modal&amp;tmpl=component&amp;2a78b7e25e9fac793dbf382b91f66d1c=1&amp;editor=jform_articletext" data-iframe="&lt;iframe class=&quot;iframe&quot; src=&quot;http://localhost:8888/sample/joomla40/administrator/index.php?option=com_content&amp;amp;view=articles&amp;amp;layout=modal&amp;amp;tmpl=component&amp;amp;2a78b7e25e9fac793dbf382b91f66d1c=1&amp;amp;editor=jform_articletext&quot; name=&quot;**Article**&quot; title=&quot;**Article**&quot; height=&quot;300px&quot; width=&quot;800px&quot;&gt;&lt;/iframe&gt;">

avatar dgrammatiko
dgrammatiko - comment - 21 Apr 2021

#jform_articletext_**Article**Modal The ** part that comes from the debug is not valid for an ID. Chenge the part there to skip the debug output for this part of the ID. It's not a JS error it's invalid HTML

avatar PhilETaylor
PhilETaylor - comment - 21 Apr 2021

Lol - just had a PR rejected for disabling language debug for genuine reasons and you want me to start that fight here too hahah

avatar infograf768
infograf768 - comment - 21 Apr 2021

In this case it is absolutely necessary for that modal part only and it concerns all xtd, not only articles modal. ;)

avatar dgrammatiko
dgrammatiko - comment - 21 Apr 2021

just had a PR rejected for disabling language debug for genuine reasons and you want me to start that fight here too hahah

If debug language creates invalid HTML then there's a need for a new SPEC compliant implementation. You can't attach random invalid characters to classes,ids, etc and expect that things will continue to work...

Edit also I don't think that an id="jform_articletext_ΆρθροModal" is valid either. The string there should not be translatable AFAIK

avatar infograf768
infograf768 - comment - 21 Apr 2021

In this case, the issue comes from /layouts/libraries/html/bootstrap/modal/main.php

code: <div id="<?php echo $selector; ?>"

avatar dgrammatiko
dgrammatiko - comment - 21 Apr 2021

In this case, the issue comes from /layouts/libraries/html/bootstrap/modal/main.php

Nope, it's coming from:

$button->text = Text::_('PLG_ARTICLE_BUTTON_ARTICLE');

Basically the object there needs also a non translated string that will be passed then to the modal as the ID: eg Article instead of **Article**

Or you can use

$button->realName = 'PlgButtonArticle';

avatar infograf768
infograf768 - comment - 21 Apr 2021

How do you pass $button->realName to the id?

avatar dgrammatiko
dgrammatiko - comment - 21 Apr 2021

Please test: #33216

avatar richard67 richard67 - close - 21 Apr 2021
avatar richard67
richard67 - comment - 21 Apr 2021

Closing as having a pull request. Please test #33216 . Thanks in advance.

avatar richard67 richard67 - change - 21 Apr 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-04-21 10:15:25
Closed_By richard67
avatar PhilETaylor
PhilETaylor - comment - 29 Apr 2021

Im getting this error again today @dgrammatiko - right out the box after installation

The string did not match the expected pattern

But only in safari.... even after reinstalling Joomla and re-npm-ing everything :(

avatar PhilETaylor
PhilETaylor - comment - 29 Apr 2021

Ignore me. My browser had "internally crashed" apparently according to mac, and on posting the comment to this thread the whole browser closed and segfaulted hahahahahahah

avatar richard67
richard67 - comment - 29 Apr 2021

Shall I re-open the issue?

avatar richard67
richard67 - comment - 29 Apr 2021

Ah ok.

avatar PhilETaylor
PhilETaylor - comment - 29 Apr 2021

Shall I re-open the issue?

Nope - totally not a problem - dumb safari.

Add a Comment

Login with GitHub to post a comment