Create some materials with tags. Create module and sort by title.
Most Pupular Articles, limit by Maximum and then sort by title
Sort by title, limit by Maximum.
Truly the most popular articles are not subject to sampling.
As far as I can see this is working exactly as it is designed to work
The module displays a list of the most popular tags and sorts them depending on the settings in the module
example:
tag | count
fauna | 5
flora | 4
nature | 2
oceans | 30
In module we want to see 3 most popular item, sorting by title.
Expecting:
fauna, flora, oceans ("slice" 3 most popular, and then sort by the title)
Actual Result:
fauna, flora, nature (sort by title, and then slice 3). MOST POPULAR TAG ON THE SITE "OCEANS" NOT SHOWING!
Status | New | ⇒ | Confirmed |
I see what you mean now. It is not working as a "popular" tag list at all - just as a list of tags
I will see if I can fix that in the morning
Looking at the code it is completely missing any "order by count" which stops it from ever being a "popular" tags module
Unlike the "popular articles" module which does have it as seen here https://github.com/joomla/joomla-cms/blob/staging/modules/mod_articles_popular/helper.php#L73
@alikon your sql is far better than mine - any idea of the best way to do it for this module
module works fine if sort by count, descending. but in cloud expecting, that displaying sort by title.
https://github.com/joomla/joomla-cms/blob/staging/modules/mod_tags_popular/helper.php it is not 3.4.8... and also not working as expecting.
lets see at
https://github.com/joomla/joomla-cms/blob/staging/modules/mod_tags_popular/helper.php#L84
$query->order($order_value . ' ' . $order_direction);
expecting, i think should be:
$query->order('count DESC');
then
...
$db->setQuery($query, 0, $maximum);
...
$results = $db->loadObjectList();
...
I think that after this should be manual processing of $results(sorting by title, etc.)
Sorry for my worst English
I agree
It works as expected, module name might be confusing. It's the default module for displaying tags. Ordering options are separate as stated in module description. It is a "popular tags" module when item count is used for ordering. When ordering by title, only title is meant to be taken into consideration to achieve alphabetical ordering. Example above would break the count direction (least popular tags wouldn't work) and alphabetical ordering.
@vitaly80 good catch
@brianteeman from a quick look we have this staging query under the issue conditions
SELECT MAX(tag_id) AS tag_id, COUNT(*) AS count,MAX(t.title) AS title,MAX(t.access) AS access,MAX(t.alias) AS alias
FROM j35b2_contentitem_tag_map AS m
INNER JOIN j35b2_tags AS t ON tag_id = t.id
INNER JOIN j35b2_ucm_content AS c ON m.core_content_id = c.core_content_id
WHERE t.access IN (1,1,5) AND t.published = 1
AND m.type_alias = c.core_type_alias
AND c.core_state = 1
AND (c.core_publish_up = 0000-00-00 00:00:00 OR c.core_publish_up <= '2016-03-10 06:28:01')
AND (c.core_publish_down = '0000-00-00 00:00:00' OR c.core_publish_down >= '2016-03-10 06:28:01')
GROUP BY tag_id,title,access,alias
ORDER BY count DESC LIMIT 0, 3
lets call this query queryA
what we need to do is simply
select a.tag_id, a.count, a.title, a.access, a.alias
from (queryA) A
order by a.title DESC
`i'll sumbit a pr in the weekend
If it is called popular tags module - then it is not working as expected
If it is called tags modules - then it is working as expected
Either way either the code or the text needs changing/fixing
On 10 March 2016 at 06:54, SharkyKZ notifications@github.com wrote:
It works as expected, module name might be confusing. It's the default
module for displaying tags. Ordering options are separate as stated in
module description. It is a "popular tags" module when item count is used
for ordering. When ordering by title, only title is meant to be taken into
consideration. Example above would break the count direction (least popular
tags wouldn't work) and alphabetical ordering.—
Reply to this email directly or view it on GitHub
#9351 (comment).
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/
It is working as a popular tags module when item count ordering and asc direction is selected. Or unpopular tags module when disc direction is selected. Or alphabetical when title ordering is selected. Etc. Forcing to select by count/desc would break this multifunctionality. A simple solution would be to add additional params to separately control display order. This would simply add another order query after the first one.
If there is no change in functionality then it cannot be called "popular
tags"
Status | Confirmed | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-03-11 17:34:58 |
Closed_By | ⇒ | brianteeman |
Closing as we have a PR for testing - #9376
@vitaly80 please test this
OK! Now works fine! Thanks @brianteeman , thanks @alikon !
@vitaly80 please can you record a successful test https://issues.joomla.org/tracker/joomla-cms/9376
Now testing many times, works perfect, but if enable "random" option - get error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0, 2' at line 7 SQL=SELECT MAX(tag_id
) AS tag_id, COUNT(*) AS count,MAX(t.title) AS title,MAX(t
.access
) AS access,MAX(t
.alias
) AS alias FROM zwdj7_contentitem_tag_map
AS m
INNER JOIN zwdj7_tags
AS t
ON tag_id
= t.id INNER JOIN zwdj7_ucm_content
AS c
ON m
.core_content_id
= c
.core_content_id
WHERE t
.access
IN (1,1,5) AND t
.published
= 1 AND m
.type_alias
= c
.core_type_alias
AND c
.core_state
= 1 AND (c
.core_publish_up
= '0000-00-00 00:00:00' OR c
.core_publish_up
<= '2016-03-11 23:21:18') AND (c
.core_publish_down
= '0000-00-00 00:00:00' OR c
.core_publish_down
>= '2016-03-11 23:21:18') GROUP BY tag_id
,title
,access
,alias
ORDER BY LIMIT 0, 2
for me it successful) but for all cases - not(
$query->order('rand()');
works perfect!)
on 3.5 works fine.
The title that is displayed is the title of the tag not the article
On 9 March 2016 at 16:01, vitaly80 notifications@github.com wrote:
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/