User tests: Successful: Unsuccessful:
Minimize the DB queries in MultilangstatusAdminHelper
Enable multilang plugin and browser backend.
See that each admin page always has 3 queries:
SELECT `enabled`
FROM `jos_extensions`
WHERE `type` = 'module' AND `element` = 'mod_multilangstatus'
\administrator\modules\mod_multilangstatus\src\Helper\MultilangstatusAdminHelper.php:46
SELECT `published`
FROM `jos_modules`
WHERE `module` = 'mod_multilangstatus'
\administrator\modules\mod_multilangstatus\src\Helper\MultilangstatusAdminHelper.php:76
UPDATE `jos_modules`
SET `published` = 1
WHERE `module` = 'mod_multilangstatus'
\administrator\modules\mod_multilangstatus\src\Helper\MultilangstatusAdminHelper.php:111
Cache is not cleaned after the module state is auto-changed.
Only a single first query is left.
Cache is cleaned after the module state is auto-changed.
No.
Status | New | ⇒ | Pending |
Category | ⇒ | Modules Administration Libraries |
@ceford I re-tested the patch and definitely see that only single first query is left:
SELECT `enabled`
FROM `jos_extensions`
WHERE `type` = 'module' AND `element` = 'mod_multilangstatus'
If "System - Language Filter" plugin is disabled, we have two queries one time (select enabled + updated published to 1) and next only single query again on the further page loads.
I have tested this item
I can now confirm that the System Language Filter plugin needs to be enable and then on the second and subsequent page loads there is only one query.
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
?
?
|
Status | Ready to Commit | ⇒ | Pending |
Back to pending
There are review comments. Unfortunately they are not visible in the issue tracker, only on GitHub, so I add this comment here to enable issue tracker readers at least to see what's the reason why the PR doesn't have RTC.
Labels |
Added:
?
Removed: ? |
I looked at the reason why this code is called and it's completely wrong in my opinion.
mod_user calls this on every page load only to magically activate/deactivate this module based on the languagefilter plugin...
I would suggest so remove this functionality:
https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/modules/mod_user/mod_user.php#L22-L33
And this magical helper too.
If someone thinks it's really needed to display this module for multilingual sites (which I don't think it's needed) @bembelimen suggest to always activate the module and return "" if the multilingual functionality is disabled.
@HLeithner I totally agree that it's better to remove this code completely. Who can make the final decision?
in this case @wilsonge but I'm pretty sure @infograf768 want to look at this
If anyone cares about my comment, displaying the multilangstatus module when languagefilter is on is a really nice new feature in J4. I don't know how many ms are concerned but if we could keep it, it would be good for our users.
I don't really understand why that code is in mod_user (could not get the history in github as the file name was changed) instead of the languagefilter plugin itself, therefore being used only when the plugin is enabled/disabled.
I don't really understand why that code is in mod_user (could not get the history in github as the file name was changed)
I think it was mod_status before.
It was in a new module: mod_status_user.php
36fd271#diff-fdad49126781a103f20288ca4be07c78b271d19c893db36c51cf391ca6e7e578
Ok I would like to suggest the following solution and I hope @Denitz can implement it.
MultilangstatusAdminHelper
(if it's only function is to activate the module).mod_user
mod_multilangstatus
per default on new installationsmod_multilangstatus
if multilanguage is active and if not return without any output.* Activate the `mod_multilangstatus` per default on new installations
That's to be done here
https://github.com/joomla/joomla-cms/blob/4.0-dev/installation/sql/mysql/base.sql#L585
and here
https://github.com/joomla/joomla-cms/blob/4.0-dev/installation/sql/postgresql/base.sql#L610
by changing NULL, NULL, 0
to NULL, NULL, 1
.
Check in mod_multilangstatus if multilanguage is active and if not return without any output.
We check that already in the module code...
![]()
Yes I know but most of the joomla sites are not multilingual and always showing the icon in the upper right corner makes no sense to me. I personally wouldn't activate it by default, but only showing the content if multi language is active is a compromise (even if I have to disable the module anyway because I don't use the standard joomla multi language system as it is intended)
Labels |
Added:
?
|
Category | Modules Administration Libraries | ⇒ | Modules Administration SQL Installation Postgresql Libraries |
Remove the MultilangstatusAdminHelper (if it's only function is to activate the module).
Remove the related code from mod_user
Activate the mod_multilangstatus per default on new installations
Check in mod_multilangstatus if multilanguage is active and if not return without any output.
@HLeithner Done.
please add the update .sql too
please add the update .sql too
@alikon As far as I could see, @HLeithner has requested that only for new installations, not for updates, so it should not need any update sql script. @HLeithner Correct me if I'm wrong.
richard is right, I think for websites that already exists have it already activated or are not multilingual. ymmv
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-11-07 12:29:31 |
Closed_By | ⇒ | HLeithner | |
Labels |
Added:
?
Removed: ? |
For me there are always two queries left after applying the patch. The one left out is the Update query which I guess should only be called if the published state is changed. Typo: in instructions I think browser should be browse - it made me wonder if there was a browser plugin. My mod_multilangstatus is unpublished.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31111.