Skip to content
Permalink
Browse files

filter unpublished categories from tagged item (#10304)

* filter  unpublished  categories from tagged item

filter  unpublished  categories from tagged item

* CS added an empty line

cs added an empty line
  • Loading branch information...
alikon authored and roland-d committed May 8, 2016
1 parent 34e1609 commit bef41c9a73463b0c7374ff2a30a2bb6a1093e9bf
Showing with 3 additions and 0 deletions.
  1. +3 −0 libraries/cms/helper/tags.php
@@ -569,6 +569,9 @@ public function getTagItemsQuery($tagId, $typesr = null, $includeChildren = fals
)
->join('INNER', '#__content_types AS ct ON ct.type_alias = m.type_alias')
// Join over categoris for get only published
->join('INNER', '#__categories AS tc ON tc.id = c.core_catid AND tc.published = 1')
// Join over the users for the author and email
->select("CASE WHEN c.core_created_by_alias > ' ' THEN c.core_created_by_alias ELSE ua.name END AS author")
->select("ua.email AS author_email")

3 comments on commit bef41c9

@ColinM2

This comment has been minimized.

Copy link

replied Sep 14, 2016

The objective of the patch is to the prevent the display of tagged items that are in unpublished categories. However the patch is incomplete and it is creating serious problems for several components that use tags in Components where items that are not assigned to a category, or items from components that allow multiple categories. This is affecting components such as jDownloads and HWDMediaShare that make use of tags.

HWDMediaShare have found a solution see
https://hwdmediashare.co.uk/blog/769-joomla-3-6-0-undesirable-change-affecting-joomla-tags-in-hwdmediashare

by changing lines 572 and 573 in libraries/cms/helper/tags.php lines from

// Join over categoris for get only published 
->join('INNER', '#__categories AS tc ON tc.id = c.core_catid AND tc.published = 1')

to

// Join over categories to only get items in published categories, or items in no category  
->join('LEFT', '#__categories AS tc ON tc.id = c.core_catid')->where('(tc.published = 1 OR tc.published IS NULL)')

ColinM

@zero-24

This comment has been minimized.

Copy link
Contributor

replied Sep 14, 2016

@ColinM2 please open a new issue / pull request with your chnages, else it get lost. Thanks.

@mbabker

This comment has been minimized.

Copy link
Member

replied Sep 14, 2016

Published should never have a null value. If some extension is setting that in the categories table, they are causing an invalid data set.

Please sign in to comment.
You can’t perform that action at this time.