? Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
28 Aug 2018

This query was duplicated

SELECT enabled
FROM tk7kk_extensions
WHERE type = 'module' AND element = 'mod_multilangstatus'

Test

Enable debug

avatar brianteeman brianteeman - open - 28 Aug 2018
avatar brianteeman brianteeman - change - 28 Aug 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 28 Aug 2018
Category Modules Administration
avatar infograf768
infograf768 - comment - 29 Aug 2018

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.

avatar infograf768
infograf768 - comment - 29 Aug 2018

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; ?>
avatar brianteeman brianteeman - change - 29 Aug 2018
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2018-08-29 06:33:08
Closed_By brianteeman
Labels Added: ?
avatar brianteeman brianteeman - close - 29 Aug 2018
avatar infograf768
infograf768 - comment - 29 Aug 2018

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?

avatar laoneo
laoneo - comment - 29 Aug 2018

Better to do a new pr.

avatar infograf768
infograf768 - comment - 29 Aug 2018

will do.

avatar infograf768
infograf768 - comment - 29 Aug 2018

done:
#21906

Add a Comment

Login with GitHub to post a comment