?
avatar ciar4n
ciar4n
31 Jan 2021

Steps to reproduce the issue

Enable 'tags similar' module. Nothing rendered. Admittedly this is not a module I am familiar with but regardless of settings I presume I should at least get a module title.

Expected result

Something

Actual result

Nothing even if title enabled. countModules comes back as true so in the frontend I get a blank space where I expect to have a module

System information (as much as possible)

Additional comments

avatar ciar4n ciar4n - open - 31 Jan 2021
avatar joomla-cms-bot joomla-cms-bot - change - 31 Jan 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 31 Jan 2021
avatar brianteeman
brianteeman - comment - 1 Feb 2021

#24879 means that you get nothing at all if there are no similar tags

Obviously you will only get similar tags if you are on a single article

With the sample data installed -

  • if you are on a blog page then you have two modules displayed at the bottom of the page in position bottom-b
  • if you are on a single article page you have three modules displayed

image

image

avatar ciar4n
ciar4n - comment - 1 Feb 2021

I get that but if no similar tags exist, should the module title still not be displayed? I would expect the following....

image

But instead, we get this because if ($this->countModules('sidebar-left')) is returning true...

image

avatar chmst
chmst - comment - 1 Feb 2021

It is a matter of taste, some want the module with title, some want no module at all.
Which for me looks like an error in html if a columns is empty and also if the content is wmpty.
Maybe we can display a text in the module "No similar tags found"?

avatar brianteeman
brianteeman - comment - 1 Feb 2021

@chmst - that was the previous behaviour.

While testing this issue I realised that this current behaviour is completely correct. Similar tags is different to other modules.

Using the Sample data as an example. We have a menu item for a blog category. The similar tags will never have any matches if displayed on the category page. But the only way to have a similar tags module on the article page is to assign the module to the blog category menu item.

avatar ciar4n
ciar4n - comment - 1 Feb 2021

Ideally then I guess the if ($this->countModules()) statement should return false if the tags similar module is empty.

avatar brianteeman
brianteeman - comment - 1 Feb 2021

The entire point of this code change was to prevent the blank space. (which it does on the sample data). If it doesnt then thats a bug. Could you please share the template code so we can try and debug

avatar ciar4n
ciar4n - comment - 1 Feb 2021

I believe the above example is pretty much using the sample data ('testing' data on cassiopeia). I disabled all other modules in the sidebar-left position with the exception of the tags similar module (I positioned it there if not already done so).

avatar brianteeman
brianteeman - comment - 1 Feb 2021

ok - taking a look. It does sound like a bug

avatar brianteeman
brianteeman - comment - 1 Feb 2021

Confirming its a bug as far as I am concerned - i have an idea

avatar brianteeman
brianteeman - comment - 1 Feb 2021

Ideally then I guess the if ($this->countModules()) statement should return false if the tags similar module is empty.

So it turns out that the code exists.

If you change
if ($this->countModules('position))
to
if ($this->countModules('position', true))

This code was added to Joomla 4 by @Fedik #19416

I guess we all forgot it existed and learned something new today

avatar ciar4n
ciar4n - comment - 1 Feb 2021

Nice.. that one is certainly news to me and resolves this issue. ?

avatar ciar4n
ciar4n - comment - 1 Feb 2021

I'll create the PR

avatar brianteeman
brianteeman - comment - 1 Feb 2021

the PR for what?

avatar ciar4n
ciar4n - comment - 1 Feb 2021

#32234 ?

avatar chmst
chmst - comment - 2 Feb 2021

Closing as we have a PR

avatar chmst chmst - change - 2 Feb 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-02-02 20:44:19
Closed_By chmst
avatar chmst chmst - close - 2 Feb 2021

Add a Comment

Login with GitHub to post a comment