?
avatar Chacapamac
Chacapamac
4 Jan 2019

Steps to reproduce the issue

Add class name to language switcher in Joomla administration

Expected result

Class name added to container element

Actual result

No class name added

System information (as much as possible)

Joomla_4.0.0-alpha7 (3 days ago)

Additional comments

Curiously seem to work with other modules ???

avatar Chacapamac Chacapamac - open - 4 Jan 2019
avatar joomla-cms-bot joomla-cms-bot - labeled - 4 Jan 2019
avatar infograf768 infograf768 - change - 4 Jan 2019
Title
Cannot add module class to language switcher module?
[4.0] Cannot add module class to language switcher module?
avatar infograf768 infograf768 - edited - 4 Jan 2019
avatar infograf768
infograf768 - comment - 4 Jan 2019

screen shot 2019-01-04 at 17 07 32

It is added to the container


screen shot 2019-01-04 at 17 04 55

avatar Chacapamac
Chacapamac - comment - 5 Jan 2019

Thanks Infograf768

With your help, I find the problem

I put my switcher in a new added position

<?php if ($this->countModules('top-tools')) : ?> <div class="grid-child container-top-tools"> <jdoc:include type="modules" name="top-tools" style="none" /> </div> <?php endif; ?>

If I change the module “style” for “default” or “xhtml”, my module class is added
<?php if ($this->countModules('top-tools')) : ?> <div class="grid-child container-top-tools"> <jdoc:include type="modules" name="top-tools" style="xhtml" /> </div> <?php endif; ?>

style="none" />
• No custom added class work in the module administration if “none”

• Also, if “none”, no div moduletable is added

Is this normal ?

avatar brianteeman
brianteeman - comment - 5 Jan 2019

Is this normal ?

yes and it is the same in joomla3

avatar infograf768
infograf768 - comment - 5 Jan 2019

In 3.x for me it is a bug.
$params->get('moduleclass_sfx') is never fetched.
Therefore
<div class="mod-languages<?php echo $moduleclass_sfx; ?>">
gives nothing.
Trying now to find why.

avatar brianteeman
brianteeman - comment - 5 Jan 2019

See

function modChrome_none($module, &$params, &$attribs)

It is by design and has been that way forever

avatar infograf768
infograf768 - comment - 5 Jan 2019

The fact that it has been like that forever does not mean it is ok.
Let's rather find how to solve this as it happens also when choosing html5 as style.

avatar infograf768
infograf768 - comment - 5 Jan 2019

I mean in 3.x

avatar infograf768
infograf768 - comment - 5 Jan 2019

In fact, the problem comes from a confusion for $params in ModLanguagesHelper::getList($params);

There, $params is not added to the module params but replaced by the plugin params.

avatar infograf768
infograf768 - comment - 5 Jan 2019

If I modify the helper (still in 3.x), I get (after adding switcherclass in the module as moduleclass_sfx):

screen shot 2019-01-05 at 11 29 57

avatar infograf768
infograf768 - comment - 5 Jan 2019

Will make patch for 3.x as the change is simple.
Would it be B/C is to be decided.
EDIT: The helper has been modified in last staging and the issue is no more present there.
:)

avatar infograf768
infograf768 - comment - 5 Jan 2019

Therefore I apologize:

Also, if “none”, no div moduletable is added
Is this normal ?

Yes it is. Closing as expected behavior.

avatar infograf768 infograf768 - change - 5 Jan 2019
Status New Closed
Closed_Date 0000-00-00 00:00:00 2019-01-05 10:54:29
Closed_By infograf768
avatar infograf768 infograf768 - close - 5 Jan 2019
avatar Chacapamac
Chacapamac - comment - 5 Jan 2019

Cool!

Add a Comment

Login with GitHub to post a comment