No Code Attached Yet
avatar brianteeman
brianteeman
7 Dec 2021

Steps to reproduce the issue

With no modules and template preview enabled all module positions should be indicated. They're not and this makes the preview completely pointless

Expected result

image

Actual result

image

Additional comments

The problem appears to originate with #35225 by @Fedik

Possibly here https://github.com/joomla/joomla-cms/pull/35225/files#r693565865

avatar brianteeman brianteeman - open - 7 Dec 2021
avatar joomla-cms-bot joomla-cms-bot - change - 7 Dec 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 7 Dec 2021
avatar chmst
chmst - comment - 7 Dec 2021

Duplicate to #36071?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36257.

avatar Fedik
Fedik - comment - 8 Dec 2021

#35225 that just fixing a cache,

The issue a bit different, since #19416 some positions rendered only if they contain any real content,
So in result you see preview only for these positions.

Possible fix, is to update if() statement a bit, example

<?php if ($this->countModules('banner', true)) : ?>
<div class="container-banner full-width">
<jdoc:include type="modules" name="banner" style="none" />
</div>
<?php endif; ?>

Change to something like:

if ($templatePreview || $this->countModules('banner', true))

Duplicate to #36071?

Yes, it the same.

avatar brianteeman
brianteeman - comment - 8 Dec 2021

#35225 that just fixing a cache,

Well the problem didnt exist before and it does after

Possible fix, is to update if() statement a bit, example

That "fix" is specific to cassiopeia so it doesnt solve the problem.

The issue a bit different, since #19416 some positions rendered only if they contain any real content,

Ok thanks for the hint I will take a look there as this issue really bugs me

avatar Fedik
Fedik - comment - 8 Dec 2021

That "fix" is specific to cassiopeia so it doesnt solve the problem.

That fix is specific for templates that use this new feature.

I wonder if old behavior still show all positions if the position does not have any module assigned in backend?
if ($this->countModules('banner'))

avatar Fedik
Fedik - comment - 8 Dec 2021

I wonder if old behavior still show all positions if the position does not have any module assigned in backend?

Yea, it is, it have this horror hack ?

if (\count($result) === 0)
{
if ($input->getBool('tp') && ComponentHelper::getParams('com_templates')->get('template_positions_display'))
{
$result[0] = static::createDummyModule();
$result[0]->title = $position;
$result[0]->position = $position;
}
}

So it force empty module, if position is empty but &tp=1 exists
hmhm

avatar Fedik
Fedik - comment - 8 Dec 2021

Well, we can extend that hack,
Can someone try to add next code and check if it works:

$result[0]->contentRendered = true;
$result[0]->content = 'Dummy module';

hm no

avatar Fedik
Fedik - comment - 8 Dec 2021

Please test #36268

avatar Fedik Fedik - change - 8 Dec 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-12-08 16:45:30
Closed_By Fedik
avatar Fedik Fedik - close - 8 Dec 2021

Add a Comment

Login with GitHub to post a comment