TEST 1
TEST 2
Test 1: The dashboard is shown
Test 2: The dashboard is shown
Test 1: The dashboard is NOT(!!!) shown
Test 2: The dashboard is shown
Irrelevant.
This is yet another blatant bug in Joomla 4 which is trivial to spot and fix — if someone actually uses the Joomla 4 features
The problem lies in
The com_cpanel component's HtmlView converts the component specific dashboard (which must be provided ascom_example.something
) to a module position by putting that dashboard string through \Joomla\CMS\Application\ApplicationHelper::stringURLSafe
.
However, what stringURLSafe
does depends on the “Unicode Slugs” setting in Global Configuration ??
When that setting is No the underscore is converted to a dash, therefore the module position for this dashboard is cpanel-com-example-something
.
When that setting Yes the underscore remains as is, therefore the module position for this dashboard is cpanel-com_example-something
.
Since a module cannot be published in two positions at the same time the Dashboard breaks depending on the Global Configuration “Unicode Slugs” setting.
You do not see that with core dashboards because Joomla cheats when it comes to itself!. Instead of using component-specific dashboards it uses hardcoded dashboard names which do not include the com_
prefix or a dot, they just contain lowercase characters a-z without diacritics. When this happens, going through stringURLSafe
returns the string verbatim, therefore Joomla's cheating dashboards always work.
Right now, there is not one valid module position to use with component-specific dashboards. The only reasonable solution is to replace
$position = ApplicationHelper::stringURLSafe($dashboard);
with
$position = \Joomla\CMS\Filter\OutputFilter::stringUrlUnicodeSlug($dashboard);
This way we will have predictable dashboards which always use the module position format cpanel-com-example-something
.
Tagging @laoneo because his bug report in my repo led me to discover the root cause of this issue (as you may have guessed, being Greek I use Unicode Slugs on my multilingual dev site…) and because he's in the leadership so he can make a decision about how to best fix this.
Labels |
Added:
No Code Attached Yet
|
I think it should be compatible with the Modules position field
joomla-cms/administrator/components/com_modules/forms/module.xml
Lines 86 to 93 in 99e177d
Wich have a filter string
in default.
joomla-cms/libraries/src/Form/FormField.php
Line 1115 in f520c98
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-09-28 07:05:10 |
Closed_By | ⇒ | Fedik |
Okay, then I will close here, because we have a PR
I didn't dig too deep into the code, but from what you describe it sounds like a legit change. As it affects only the admin dashboard view it looks like that nothing will break as it doesn't work correctly anyway.