?
avatar paul-muckypuddle
paul-muckypuddle
26 Jul 2017

Steps to reproduce the issue

  1. Create a layout override for mod_articles_category
  2. Create a module that uses the layout override
  3. Within your layout, in the loop to output items, try to access $item->tags

Expected result

The item tags are part of the item object and can be used in the layout.

Actual result

They're not. $item->tags is undefined and throws a PHP error

System information (as much as possible)

Joomla 3.7.4
Apache 2.4
PHP 5.6
Centos 7

Additional comments

This is a direct result of #16335. Any existing layouts that make use of tag data now throw errors as the helper file in all mod_articles_* modules calls $articles->setState('load_tags', false);, preventing tags from being loaded.

Proposed solution

Add an advanced option to each of the mod_articles_* modules to allows the user to decide if tags should be loaded, rather than hardcoding it on the assumption they won't be required.

avatar paul-muckypuddle paul-muckypuddle - open - 26 Jul 2017
avatar joomla-cms-bot joomla-cms-bot - change - 26 Jul 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 26 Jul 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 26 Jul 2017
Category com_modules com_tags
avatar brianteeman
brianteeman - comment - 3 Aug 2017

@mbabker it was your PR that apparently broke this

avatar franz-wohlkoenig franz-wohlkoenig - change - 3 Aug 2017
Status New Information Required
avatar alikon
alikon - comment - 3 Aug 2017

should be solved by #16945

avatar paul-muckypuddle
paul-muckypuddle - comment - 3 Aug 2017

@alikon Not sure if it will - #16945 allows you to filter by 1 or more tags, but still doesn't return the tag information which is the issue here.

avatar mbabker
mbabker - comment - 3 Aug 2017

Well, there's either two options here.

  1. Revert that PR's changes in the modules and always load tag data no matter what (trace back to the original issue report for why this can be problematic)
  2. If someone needs these modules with tag data loaded in they'll need to fork them
avatar paul-muckypuddle
paul-muckypuddle - comment - 3 Aug 2017

Perhaps a third way is a toggle as per the issue proposed solution? Call it 'Load Tags?', set to No by default (as I believe the only layouts using tags will be custom overrides) and allow power users / devs to pick.

Forking every mod_articles_* module, along with the associated hassle in keeping them in sync with updates to Joomla, just to comment out 1 line of code seems drastic.

avatar franz-wohlkoenig franz-wohlkoenig - change - 26 Aug 2017
Status Information Required Discussion
avatar paul-muckypuddle
paul-muckypuddle - comment - 29 Aug 2017

Just wondering if anyone has had any further thoughts on this - we're holding back on upgrading a few of our sites as they use tag data in a layout and the upgrade will break them, and I'm getting poked by Phil's robots at myJoomla to upgrade 😄

avatar brianteeman brianteeman - labeled - 25 Mar 2018
avatar joomla-cms-bot joomla-cms-bot - change - 28 Apr 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-04-28 11:02:44
Closed_By joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 28 Apr 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 28 Apr 2018
Closed_By joomla-cms-bot franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - unlabeled - 28 Apr 2018
avatar joomla-cms-bot
joomla-cms-bot - comment - 28 Apr 2018
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 28 Apr 2018

closed as having Pull Request #20248.

Add a Comment

Login with GitHub to post a comment