?
avatar infograf768
infograf768
7 Jul 2018

Steps to reproduce the issue

Create a multilingual site.

Expected result

The multilingual status module displays in the status position.

Actual result

the icon does not display
var_dump gives

Error: Class 'Joomla\Module\Multilangstatus\Administrator\Helper\MultilangstatusAdminHelper' not found: Class 'Joomla\Module\Multilangstatus\Administrator\Helper\MultilangstatusAdminHelper' not found

avatar infograf768 infograf768 - open - 7 Jul 2018
avatar joomla-cms-bot joomla-cms-bot - change - 7 Jul 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 7 Jul 2018
avatar brianteeman
brianteeman - comment - 7 Jul 2018

Same.as #20823 ?

avatar franz-wohlkoenig franz-wohlkoenig - change - 7 Jul 2018
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 7 Jul 2018
Category Multilanguage
avatar infograf768
infograf768 - comment - 7 Jul 2018

maybe similar but not the same afaik. this one concerns modules

avatar infograf768
infograf768 - comment - 7 Jul 2018
avatar mbabker
mbabker - comment - 7 Jul 2018
avatar brianteeman
brianteeman - comment - 7 Jul 2018

Delete the namespace map and let the plugin recreate it as explained in 20902 and see if that fixes it. If it did then it's not an error in joomla and is caused by an old branch

avatar infograf768
infograf768 - comment - 8 Jul 2018

OK, found the issue and will solve it.

Background

This happens on a clean install, not an old branch at all
Deleting autoload_psr4.php and letting the plugin recreate it has no effect.
Deleting the namespacemap.php file makes no sense and, if done, kills the site with "Error".

Real tests saves a lot of time: It takes 10 minutes to create such a site.

The call to MultilangstatusAdminHelper is done in the mod_status module
https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/modules/mod_status/tmpl/default.php#L20
and used further down multiple times

Just var_dump(MultilangstatusAdminHelper::isEnabled()); line 21 to get the class not found.

The issue is solved if I manually modify /libraries/autoload_psr4.php

by adding
'Joomla\\Module\\Multilangstatus\\Administrator\\' => [JPATH_ROOT . "/administrator/modules/mod_multilangstatus",],

Therefore
/libraries/namespacemap.php is unable to add that line.
I trace this to the _extensions table namespace column for the module:
It is empty and therefore protected function getNamespacedExtensions() does not return the extension.
Looked at our sql: it does not include the namespace for that module.
Also not in the update sql.

Will make a patch to add Joomla\Module\Multilangstatus in the namespace column for that module in joomla.sql as well as in the sql update.

avatar infograf768
infograf768 - comment - 8 Jul 2018

I prepared a patch but my results are weird for anew install.

diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-07-08.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-07-08.sql
new file mode 100644
index 0000000..5ff17f1
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-07-08.sql
@@ -0,0 +1 @@
+UPDATE `#__extensions` SET `namespace` = 'Joomla\\Module\\Multilangstatus' WHERE `name` = 'mod_multilangstatus';
diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-07-08.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-07-08.sql
new file mode 100644
index 0000000..5ff17f1
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-07-08.sql
@@ -0,0 +1 @@
+UPDATE `#__extensions` SET `namespace` = 'Joomla\\Module\\Multilangstatus' WHERE `name` = 'mod_multilangstatus';
diff --git a/installation/sql/mysql/joomla.sql b/installation/sql/mysql/joomla.sql
index ef95d53..661b221 100644
--- a/installation/sql/mysql/joomla.sql
+++ b/installation/sql/mysql/joomla.sql
@@ -572,5 +572,5 @@
 (311, 0, 'mod_title', 'module', 'mod_title', '', 1, 1, 1, 0, '', '', 0, '0000-00-00 00:00:00', 0, 0, ''),
 (312, 0, 'mod_toolbar', 'module', 'mod_toolbar', '', 1, 1, 1, 1, '', '', 0, '0000-00-00 00:00:00', 0, 0, ''),
-(313, 0, 'mod_multilangstatus', 'module', 'mod_multilangstatus', '', 1, 1, 1, 0, '', '{"cache":"0"}', 0, '0000-00-00 00:00:00', 0, 0, ''),
+(313, 0, 'mod_multilangstatus', 'module', 'mod_multilangstatus', '', 1, 1, 1, 0, '', '{"cache":"0"}', 0, '0000-00-00 00:00:00', 0, 0, 'Joomla\\Module\\Multilangstatus'),
 (314, 0, 'mod_version', 'module', 'mod_version', '', 1, 1, 1, 0, '', '{"cache":"0"}', 0, '0000-00-00 00:00:00', 0, 0, 'Joomla\\Module\\Version'),
 (315, 0, 'mod_stats_admin', 'module', 'mod_stats_admin', '', 1, 1, 1, 0, '', '{"serverinfo":"0","siteinfo":"0","counter":"0","increase":"0","cache":"1","cache_time":"900","cachemode":"static"}', 0, '0000-00-00 00:00:00', 0, 0, 'Joomla\\Module\\StatsAdmin'),
diff --git a/installation/sql/postgresql/joomla.sql b/installation/sql/postgresql/joomla.sql
index 49c687a..e0c4fd6 100644
--- a/installation/sql/postgresql/joomla.sql
+++ b/installation/sql/postgresql/joomla.sql
@@ -585,5 +585,5 @@
 (311, 0, 'mod_title', 'module', 'mod_title', '', 1, 1, 1, 0, '', '', 0, '1970-01-01 00:00:00', 0, 0, ''),
 (312, 0, 'mod_toolbar', 'module', 'mod_toolbar', '', 1, 1, 1, 1, '', '', 0, '1970-01-01 00:00:00', 0, 0, ''),
-(313, 0, 'mod_multilangstatus', 'module', 'mod_multilangstatus', '', 1, 1, 1, 0, '', '{"cache":"0"}', 0, '1970-01-01 00:00:00', 0, 0, ''),
+(313, 0, 'mod_multilangstatus', 'module', 'mod_multilangstatus', '', 1, 1, 1, 0, '', '{"cache":"0"}', 0, '1970-01-01 00:00:00', 0, 0, 'Joomla\\Module\\Multilangstatus'),
 (314, 0, 'mod_version', 'module', 'mod_version', '', 1, 1, 1, 0, '', '{"cache":"0"}', 0, '1970-01-01 00:00:00', 0, 0, ''),
 (315, 0, 'mod_stats_admin', 'module', 'mod_stats_admin', '', 1, 1, 1, 0, '', '{"serverinfo":"0","siteinfo":"0","counter":"0","increase":"0","cache":"1","cache_time":"900","cachemode":"static"}', 0, '1970-01-01 00:00:00', 0, 0, ''),

When I do a clean install, the namespace is still NOT added in the column.
If I update with the specific query, it works fine.

Any idea?

avatar joomla-cms-bot joomla-cms-bot - change - 9 Jul 2018
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 9 Jul 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 9 Jul 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-07-09 03:59:30
Closed_By franz-wohlkoenig
avatar joomla-cms-bot
joomla-cms-bot - comment - 9 Jul 2018
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 9 Jul 2018

closed as having Pull Request #21020

Add a Comment

Login with GitHub to post a comment