User tests: Successful: Unsuccessful:
This query was duplicated
SELECT enabled
FROM tk7kk_extensions
WHERE type
= 'module' AND element
= 'mod_multilangstatus'
Enable debug
Status | New | ⇒ | Pending |
Category | ⇒ | Modules Administration |
To avoid the double query we could do this if we want to only show the module when multilingual is on).
I commented the code to take off and added in the conditional
// Check if the multilangstatus module is present in the site
//if (class_exists(MultilangstatusAdminHelper::class) && MultilangstatusAdminHelper::isEnabled())
//{
// Publish/Unpublish the module if it exists in the modules table
// depending on the status of the languagefilter
//MultilangstatusAdminHelper::publish();
//}
?>
<div class="ml-auto">
<ul class="nav text-center">
<?php if (class_exists(MultilangstatusAdminHelper::class) && MultilangstatusAdminHelper::isEnabled()) : ?>
<?php if (Multilanguage::isEnabled()) : ?>
<?php MultilangstatusAdminHelper::publish(); ?>
<?php $module = ModuleHelper::getModule('mod_multilangstatus'); ?>
<?php echo ModuleHelper::renderModule($module); ?>
<?php else : ?>
<?php MultilangstatusAdminHelper::publish(); ?>
<?php endif; ?>
<?php endif; ?>
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-08-29 06:33:08 |
Closed_By | ⇒ | brianteeman | |
Labels |
Added:
?
|
Would you like me to do a new PR (just to solve the double query) with the code I posted above, or do you take care of it?
Better to do a new pr.
will do.
Contrary to the intention of the original coder to display the multilingual status automatically ONLY when multilang is enabled, this patch displays it also when the site is monolingual.
That could be discussed indeed, but this PR also breaks what was added in 5005838#diff-870be7804424d0f44d0e7e48901a743f i.e. setting the module to Published in the Modules Manager page when the module exists and is enabled in the site.