-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.2] Dashboards for third party extensions break when Unicode Aliases is toggled in Global Configuration #38849
Comments
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. |
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 joomla-cms/libraries/src/Form/FormField.php Line 1115 in f520c98
|
Okay, then I will close here, because we have a PR |
* Fix third party component dashboards * Remove unused `use` statement * Make the position compatible with the string filter See #38849 (comment)
Steps to reproduce the issue
TEST 1
TEST 2
Expected result
Test 1: The dashboard is shown
Test 2: The dashboard is shown
Actual result
Test 1: The dashboard is NOT(!!!) shown
Test 2: The dashboard is shown
System information (as much as possible)
Irrelevant.
Additional comments
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
joomla-cms/administrator/components/com_cpanel/src/View/Cpanel/HtmlView.php
Line 64 in f520c98
com_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 throughstringURLSafe
returns the string verbatim, therefore Joomla's cheating dashboards always work.Proposal
Right now, there is not one valid module position to use with component-specific dashboards. The only reasonable solution is to replace
with
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.
The text was updated successfully, but these errors were encountered: