PR-4.3-dev Pending

User tests: Successful: Unsuccessful:

avatar hendrikbehncke
hendrikbehncke
22 Mar 2023

Summary of Changes

Item count on a category takes the publish_up and publish_down dates into account.

Actual result BEFORE applying this Pull Request

When setting a publish_down date in the past to unpublish an article the item count on a category will still count this article as published. And vice versa with a publish_up date in the future. The Categories view shows a different amount of articles than actually visible on the Category Blog view

Expected result AFTER applying this Pull Request

Categories view will show the exact number of articles published in a category.

avatar joomla-cms-bot joomla-cms-bot - change - 22 Mar 2023
Category Libraries
avatar hendrikbehncke hendrikbehncke - open - 22 Mar 2023
avatar hendrikbehncke hendrikbehncke - change - 22 Mar 2023
Status New Pending
avatar richard67
richard67 - comment - 30 Mar 2023

Can we be really sure that all tables $this->_table used here

->from($db->quoteName($db->escape($this->_table), 'i'))
have publish_up and publish_down columns? If that table doesn't have these columns, we will get an SQL error about an unknown column when executing the SQL statement which is extended by this PR.

avatar Denitz
Denitz - comment - 31 Mar 2023

It will frustrate a user: you will see X published articles but if you click the red counter and navigate to article list with &filter[published]=0 filter you will see no articles because they are actually published (#__content.state = 1).

Not a good idea. Either skip it or implement a separate counter of smth like "currently unpublished" items.

avatar hendrikbehncke hendrikbehncke - change - 31 Mar 2023
Labels Added: PR-4.3-dev
avatar hendrikbehncke
hendrikbehncke - comment - 31 Mar 2023

Hi @richard67, that could indeed be an issue.
Maybe passing the fields in the options in components/com_content/src/Service/Category.php could solve this?

Or alternatively people use 3rd party plugins to automatically update the published flag depending on the publish_up and publish_down dates.

avatar HLeithner
HLeithner - comment - 30 Sep 2023

This pull request has been automatically rebased to 4.4-dev.

avatar HLeithner HLeithner - change - 24 Apr 2024
Title
Category Item count takes publish dates into account
[4.4] Category Item count takes publish dates into account
avatar HLeithner HLeithner - edited - 24 Apr 2024
avatar HLeithner
HLeithner - comment - 15 Nov 2024

This pull request has been automatically rebased to 5.2-dev.

avatar HLeithner HLeithner - change - 15 Nov 2024
Title
[4.4] Category Item count takes publish dates into account
[5.2] Category Item count takes publish dates into account
avatar HLeithner HLeithner - edited - 15 Nov 2024

Add a Comment

Login with GitHub to post a comment