User tests: Successful: 0 Unsuccessful: 0
Item count on a category takes the publish_up and publish_down dates into account.
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
Categories view will show the exact number of articles published in a category.
Category | ⇒ | Libraries |
Status | New | ⇒ | Pending |
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.
Labels |
Added:
PR-4.3-dev
|
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.
This pull request has been automatically rebased to 4.4-dev.
Title |
|
This pull request has been automatically rebased to 5.2-dev.
Title |
|
As @richard67 wrote, it isn't guaranteed that each table has these publish_up and publish_down columns, so you would have to definitely check for their existence. Since this is not exactly possible the way this is currently implemented, maybe change the parameter for countitems to allow this? For example if it is set to 2, it is checking for those fields and otherwise it will have the old behavior? You would then have to change this in the core where applicable.
@hendrikbehncke Can you please work on the changes I asked for? Thank you!
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-01-18 09:34:15 |
Closed_By | ⇒ | rdeutz | |
Labels |
Added:
Updates Requested
bug
PR-4.4-dev
PR-5.2-dev
Removed: PR-4.3-dev |
Here we have more a wording than an implementation problem. We have a state, can be published, unplublished, archived and trashed. And we have a visibility based on a timestamp, that we call it "Start Published" and "Finish Publshed" is misleading. So the category view shows the published items and includes the non visible items. The implementation here has also the problem that the not visible items are not counted in under the unpublished.
Long story short, we agreed to close this PR.
Can we be really sure that all tables
$this->_table
used herejoomla-cms/libraries/src/Categories/Categories.php
Line 341 in 7c3d332
publish_up
andpublish_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.