Added Article count (published, unpublished, trashed) to Category Man… #6916

Closed
wants to merge 15 commits into
from

Conversation

Projects
None yet
@pe7er
Contributor

pe7er commented May 10, 2015

…ager for com_content component.

In Joomla 1.5 the Category Manager showed the number of published, unpublished and trashed articles per category. Since than the Category Manager has been improved to be more generic and is used in all core components. You can even use it in your own component. However, because it's more generic, it does not show the counter anymore.

This PR adds the number of published, unpublished and trashed articles in the Category Manager for the Articles only.

Testing instruction

Test before Patch

The Category Manager shows the Categories but does not show number of articles in those categories.
(in back-end: Content > Category Manager)
screen shot 2015-05-10 at 07 06 04

Test after applying Patch

Install the patch via Patch Tester Component. In Article Manager, unpublish a couple of articles & trash a couple of articles. Go to Category Manager (Content > Category Manager). The Category Manager should show 3 new columns with the numbers of published, unpublished and trashed articles per category.
screen shot 2015-05-10 at 07 06 04

Test the Category Manager with other core components

The Category Manager should not show those columns & numbers for other components. Eg. check the "Category Manager: Contacts" (Components > Contacts > Categories)
screen shot 2015-05-10 at 07 06 03

@brianteeman

This comment has been minimized.

Show comment
Hide comment
@brianteeman

brianteeman May 10, 2015

Contributor

Doesnt this require an update for the hathor template overrided

On 10 May 2015 at 12:46, Peter Martin notifications@github.com wrote:

…ager for com_content component.

In Joomla 1.5 the Category Manager showed the number of published,
unpublished and trashed articles per category. Since than the Category
Manager has been improved to be more generic and is used in all core
components. You can even use it in your own component. However, because
it's more generic, it does not show the counter anymore.

This PR adds the number of published, unpublished and trashed articles in
the Category Manager for the Articles only.

[Testing instruction will follow soon...]

You can view, comment on, or merge this pull request online at:

#6916
Commit Summary

  • Added Article count (published, unpublished, trashed) to Category
    Manager for com_content component.

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#6916.

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

Contributor

brianteeman commented May 10, 2015

Doesnt this require an update for the hathor template overrided

On 10 May 2015 at 12:46, Peter Martin notifications@github.com wrote:

…ager for com_content component.

In Joomla 1.5 the Category Manager showed the number of published,
unpublished and trashed articles per category. Since than the Category
Manager has been improved to be more generic and is used in all core
components. You can even use it in your own component. However, because
it's more generic, it does not show the counter anymore.

This PR adds the number of published, unpublished and trashed articles in
the Category Manager for the Articles only.

[Testing instruction will follow soon...]

You can view, comment on, or merge this pull request online at:

#6916
Commit Summary

  • Added Article count (published, unpublished, trashed) to Category
    Manager for com_content component.

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#6916.

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

@pe7er

This comment has been minimized.

Show comment
Hide comment
@pe7er

pe7er May 10, 2015

Contributor

Yes, thanks, you are right about that.

Could you please test this PR with the default Isis template?

If there are no errors then I will write and add a fix for the Hathor template override.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

Contributor

pe7er commented May 10, 2015

Yes, thanks, you are right about that.

Could you please test this PR with the default Isis template?

If there are no errors then I will write and add a fix for the Hathor template override.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

@zero-24

This comment has been minimized.

Show comment
Hide comment
@zero-24

zero-24 May 10, 2015

Contributor

@pe7er can you try to fix the Travis errors?

FILE: ...oomla-cms/administrator/components/com_categories/models/categories.php
--------------------------------------------------------------------------------
FOUND 12 ERROR(S) AFFECTING 12 LINE(S)
--------------------------------------------------------------------------------
 279 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 280 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 281 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 282 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 283 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 284 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 286 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 287 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 289 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 290 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 292 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 293 | ERROR | Tabs must be used to indent lines; spaces are not allowed
--------------------------------------------------------------------------------
UPGRADE TO PHP_CODESNIFFER 2.0 TO FIX ERRORS AUTOMATICALLY
--------------------------------------------------------------------------------

and agline the new code into the views? If you would i can do a PR against yours 😄

Contributor

zero-24 commented May 10, 2015

@pe7er can you try to fix the Travis errors?

FILE: ...oomla-cms/administrator/components/com_categories/models/categories.php
--------------------------------------------------------------------------------
FOUND 12 ERROR(S) AFFECTING 12 LINE(S)
--------------------------------------------------------------------------------
 279 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 280 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 281 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 282 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 283 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 284 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 286 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 287 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 289 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 290 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 292 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 293 | ERROR | Tabs must be used to indent lines; spaces are not allowed
--------------------------------------------------------------------------------
UPGRADE TO PHP_CODESNIFFER 2.0 TO FIX ERRORS AUTOMATICALLY
--------------------------------------------------------------------------------

and agline the new code into the views? If you would i can do a PR against yours 😄

@pe7er

This comment has been minimized.

Show comment
Hide comment
@pe7er

pe7er May 10, 2015

Contributor

Oops... Thanks, I'll do that later...

(reminder to myself: reconfigure PHPStorm to use real tabs)


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

Contributor

pe7er commented May 10, 2015

Oops... Thanks, I'll do that later...

(reminder to myself: reconfigure PHPStorm to use real tabs)


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

@zero-24

This comment has been minimized.

Show comment
Hide comment
@zero-24

zero-24 May 10, 2015

Contributor

@test @pe7er can you also center the values else we get something like this:
center_categors

Contributor

zero-24 commented May 10, 2015

@test @pe7er can you also center the values else we get something like this:
center_categors

@brianteeman

This comment has been minimized.

Show comment
Hide comment
@brianteeman

brianteeman May 10, 2015

Contributor

I would prefer them all to be left aligned. BUT whatever you do it should
be consistent with the th and the td

On 10 May 2015 at 13:26, zero-24 notifications@github.com wrote:

@test https://github.com/test @pe7er https://github.com/pe7er can you
also center the values else we get something like this:
[image: center_categors]
https://cloud.githubusercontent.com/assets/2596554/7554255/911c23ae-f720-11e4-8ff9-3b0c27ce342e.PNG


Reply to this email directly or view it on GitHub
#6916 (comment).

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

Contributor

brianteeman commented May 10, 2015

I would prefer them all to be left aligned. BUT whatever you do it should
be consistent with the th and the td

On 10 May 2015 at 13:26, zero-24 notifications@github.com wrote:

@test https://github.com/test @pe7er https://github.com/pe7er can you
also center the values else we get something like this:
[image: center_categors]
https://cloud.githubusercontent.com/assets/2596554/7554255/911c23ae-f720-11e4-8ff9-3b0c27ce342e.PNG


Reply to this email directly or view it on GitHub
#6916 (comment).

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

@zero-24

This comment has been minimized.

Show comment
Hide comment
@zero-24

zero-24 May 10, 2015

Contributor

Just one bug more on mobile it looks bad as we have the icons but not the values see:
counts_on_phone

Contributor

zero-24 commented May 10, 2015

Just one bug more on mobile it looks bad as we have the icons but not the values see:
counts_on_phone

@brianteeman

This comment has been minimized.

Show comment
Hide comment
@brianteeman

brianteeman May 10, 2015

Contributor

Not sure I understand why

  1. You are only doing this for com_content
  2. You are only showing 3 of the 4 states

On 10 May 2015 at 13:29, zero-24 notifications@github.com wrote:

Just one bug more on mobile it looks bad as we have the icons but not the
values see:
[image: counts_on_phone]
https://cloud.githubusercontent.com/assets/2596554/7554265/def36416-f720-11e4-8764-cef34439bed3.PNG


Reply to this email directly or view it on GitHub
#6916 (comment).

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

Contributor

brianteeman commented May 10, 2015

Not sure I understand why

  1. You are only doing this for com_content
  2. You are only showing 3 of the 4 states

On 10 May 2015 at 13:29, zero-24 notifications@github.com wrote:

Just one bug more on mobile it looks bad as we have the icons but not the
values see:
[image: counts_on_phone]
https://cloud.githubusercontent.com/assets/2596554/7554265/def36416-f720-11e4-8764-cef34439bed3.PNG


Reply to this email directly or view it on GitHub
#6916 (comment).

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

@pe7er

This comment has been minimized.

Show comment
Hide comment
@pe7er

pe7er May 10, 2015

Contributor

Thank you both for all feedback!

  1. You are only doing this for com_content
  • com_content is the most important component in the CMS.
  • It's possible to do it for all core components but you'll need a lot of extra code & checks
  • The Category Manager component can be used in 3rd party extensions as well, but there you cannot add these fields.
  • Someone here at Joomladay France asked me about it. He used this feature in the past in J1.5 a lot and missed it in 3.x.
  1. You are only showing 3 of the 4 states
Contributor

pe7er commented May 10, 2015

Thank you both for all feedback!

  1. You are only doing this for com_content
  • com_content is the most important component in the CMS.
  • It's possible to do it for all core components but you'll need a lot of extra code & checks
  • The Category Manager component can be used in 3rd party extensions as well, but there you cannot add these fields.
  • Someone here at Joomladay France asked me about it. He used this feature in the past in J1.5 a lot and missed it in 3.x.
  1. You are only showing 3 of the 4 states
@brianteeman

This comment has been minimized.

Show comment
Hide comment
@brianteeman

brianteeman May 10, 2015

Contributor

The Category Manager component can be used in 3rd party extensions as
well, but there you cannot add these fields.

Really?
On 10 May 2015 14:59, "Peter Martin" notifications@github.com wrote:

Thank you both for all feedback!

  1. You are only doing this for com_content
  • com_content is the most important component in the CMS.

  • It's possible to do it for all core components but you'll need a lot
    of extra code & checks

  • The Category Manager component can be used in 3rd party extensions
    as well, but there you cannot add these fields.

  • Someone here at Joomladay France asked me about it. He used this
    feature in the past in J1.5 a lot and missed it in 3.x.

    1. You are only showing 3 of the 4 states


Reply to this email directly or view it on GitHub
#6916 (comment).

Contributor

brianteeman commented May 10, 2015

The Category Manager component can be used in 3rd party extensions as
well, but there you cannot add these fields.

Really?
On 10 May 2015 14:59, "Peter Martin" notifications@github.com wrote:

Thank you both for all feedback!

  1. You are only doing this for com_content
  • com_content is the most important component in the CMS.

  • It's possible to do it for all core components but you'll need a lot
    of extra code & checks

  • The Category Manager component can be used in 3rd party extensions
    as well, but there you cannot add these fields.

  • Someone here at Joomladay France asked me about it. He used this
    feature in the past in J1.5 a lot and missed it in 3.x.

    1. You are only showing 3 of the 4 states


Reply to this email directly or view it on GitHub
#6916 (comment).

@Bakual

This comment has been minimized.

Show comment
Hide comment
@Bakual

Bakual May 10, 2015

Contributor

I don't like com_content specific checks in com_categories.
It should instead be done in a way which works for other extensions as well.

There is already a category helper which defines the respective table and state field for a component. Maybe that could be used to get the counts?

Contributor

Bakual commented May 10, 2015

I don't like com_content specific checks in com_categories.
It should instead be done in a way which works for other extensions as well.

There is already a category helper which defines the respective table and state field for a component. Maybe that could be used to get the counts?

@Bakual

This comment has been minimized.

Show comment
Hide comment
@Bakual

Bakual May 10, 2015

Contributor

Also you may want to check the space used for that information. There is a lengthy title for only a number, which in the end cuts down space for the (much more important) title. Maybe just the icon as title would be sufficient? Or some UI guy has a clever idea?

Contributor

Bakual commented May 10, 2015

Also you may want to check the space used for that information. There is a lengthy title for only a number, which in the end cuts down space for the (much more important) title. Maybe just the icon as title would be sufficient? Or some UI guy has a clever idea?

@pe7er

This comment has been minimized.

Show comment
Hide comment
@pe7er

pe7er May 10, 2015

Contributor

The Category Manager component can be used in 3rd party extensions as
well, but there you cannot add these fields.

Really?

Yeah, change
/administrator/index.php?option=com_categories&extension=com_content
to
/administrator/index.php?option=com_categories&extension=com_messages
to see that you can trigger the Messaging component with "Category Manager". You can create categories for your Messages, but as the Message items do not have a catid, the categories will be useless for the messages.

This feature is very nice and can be used in your own custom components!!!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

Contributor

pe7er commented May 10, 2015

The Category Manager component can be used in 3rd party extensions as
well, but there you cannot add these fields.

Really?

Yeah, change
/administrator/index.php?option=com_categories&extension=com_content
to
/administrator/index.php?option=com_categories&extension=com_messages
to see that you can trigger the Messaging component with "Category Manager". You can create categories for your Messages, but as the Message items do not have a catid, the categories will be useless for the messages.

This feature is very nice and can be used in your own custom components!!!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

@dgrammatiko

This comment has been minimized.

Show comment
Hide comment
@dgrammatiko

dgrammatiko May 10, 2015

Member

I like this change. About a possible lengthy title: One solution could be, the that holds the title to have two lines so the information Alias span to a new line. Also word-wrap: break-word; could be handy here.
As mentioned before mobile hidden and placement of the td’s needs some work.
But 💯 for the idea!

Member

dgrammatiko commented May 10, 2015

I like this change. About a possible lengthy title: One solution could be, the that holds the title to have two lines so the information Alias span to a new line. Also word-wrap: break-word; could be handy here.
As mentioned before mobile hidden and placement of the td’s needs some work.
But 💯 for the idea!

@pe7er

This comment has been minimized.

Show comment
Hide comment
@pe7er

pe7er May 10, 2015

Contributor

I'm working on all the feedback and will even implement some extra functionality + better layout very soon...


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

Contributor

pe7er commented May 10, 2015

I'm working on all the feedback and will even implement some extra functionality + better layout very soon...


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

@brianteeman

This comment has been minimized.

Show comment
Hide comment
@brianteeman

brianteeman May 10, 2015

Contributor

to see that you can trigger the Messaging component with "Category Manager". You can create categories for your Messages, but as the Message items do not have a catid, the categories will be useless for the messages.

Actually you cant create them as there is no ability ti save the category ;)

Contributor

brianteeman commented May 10, 2015

to see that you can trigger the Messaging component with "Category Manager". You can create categories for your Messages, but as the Message items do not have a catid, the categories will be useless for the messages.

Actually you cant create them as there is no ability ti save the category ;)

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost May 10, 2015

I did not want to show too much information and IMHO "Archived" is less important than the other 3 states.

Sorry, why? Just because you don't use this status? ;-)

The Menu Manager shows these 3 states too. Menus > Menu Manager.

Yes, but just because you cannot archive menu items.

ghost commented May 10, 2015

I did not want to show too much information and IMHO "Archived" is less important than the other 3 states.

Sorry, why? Just because you don't use this status? ;-)

The Menu Manager shows these 3 states too. Menus > Menu Manager.

Yes, but just because you cannot archive menu items.

@pe7er

This comment has been minimized.

Show comment
Hide comment
@pe7er

pe7er May 10, 2015

Contributor

I've made some changes in the Category Manager:
now the counted Articles per Category have different colors & are hyperlinked to the Article Manager,
and the right filters are set: Category (+ level) + state.

New version:
screen shot 2015-05-10 at 12 16 30


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

Contributor

pe7er commented May 10, 2015

I've made some changes in the Category Manager:
now the counted Articles per Category have different colors & are hyperlinked to the Article Manager,
and the right filters are set: Category (+ level) + state.

New version:
screen shot 2015-05-10 at 12 16 30


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

@dgrammatiko

This comment has been minimized.

Show comment
Hide comment
@dgrammatiko

dgrammatiko May 10, 2015

Member

How about
screen shot 2015-05-10 at 8 24 59

change line 159 to p
add a class alias before class small
add css to alias margin: 2px 0 -7px;

Alias can be as lengthy as the title and for languages like German with very long words this can be a problem.
This proposal needs review because if it gets accepted we have to adjust all the views in isis

Member

dgrammatiko commented May 10, 2015

How about
screen shot 2015-05-10 at 8 24 59

change line 159 to p
add a class alias before class small
add css to alias margin: 2px 0 -7px;

Alias can be as lengthy as the title and for languages like German with very long words this can be a problem.
This proposal needs review because if it gets accepted we have to adjust all the views in isis

@zero-24 zero-24 added the New Feature label May 10, 2015

@pe7er

This comment has been minimized.

Show comment
Hide comment
@pe7er

pe7er May 10, 2015

Contributor

Ok, makes sense about "Archive.
I have:

Contributor

pe7er commented May 10, 2015

Ok, makes sense about "Archive.
I have:

@pe7er

This comment has been minimized.

Show comment
Hide comment
@pe7er

pe7er May 10, 2015

Contributor

@dgt41 Thanks for your feedback.

I agree about the aliases. However, in your screenshot there are no multiple level sub categories. I've to check how it looks to put the alias on the next line with the sub categories.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

Contributor

pe7er commented May 10, 2015

@dgt41 Thanks for your feedback.

I agree about the aliases. However, in your screenshot there are no multiple level sub categories. I've to check how it looks to put the alias on the next line with the sub categories.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

@pe7er

This comment has been minimized.

Show comment
Hide comment
@pe7er

pe7er May 10, 2015

Contributor

@Bakual I agree with you that it's not so nice to have com_content specific checks in com_categories.

If (3rd party) components would be able to add their own count using a helper file that works together with com_categories, then it would be much better...

I'll check out your suggestion some other time soon.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.
Contributor

pe7er commented May 10, 2015

@Bakual I agree with you that it's not so nice to have com_content specific checks in com_categories.

If (3rd party) components would be able to add their own count using a helper file that works together with com_categories, then it would be much better...

I'll check out your suggestion some other time soon.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.
@pe7er

This comment has been minimized.

Show comment
Hide comment
@pe7er

pe7er May 10, 2015

Contributor

Mhh. sorry Travis... my code failed :-(

I'll correct it soon, but some other time.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

Contributor

pe7er commented May 10, 2015

Mhh. sorry Travis... my code failed :-(

I'll correct it soon, but some other time.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

@Bakual

This comment has been minimized.

Show comment
Hide comment
@Bakual

Bakual May 11, 2015

Contributor

@pe7er Imho you should be able to use JCategories (which makes use of those extension specific helper classes) to retrieve the contents of a given category.

Contributor

Bakual commented May 11, 2015

@pe7er Imho you should be able to use JCategories (which makes use of those extension specific helper classes) to retrieve the contents of a given category.

@pe7er

This comment has been minimized.

Show comment
Hide comment
@pe7er

pe7er May 12, 2015

Contributor

I've added titles to the hyperlinks under the counters (and changed the language file),
changed column width to 1% because I did not like the layout on a large screen
and added the Article Count to the Hathor template override.

I hope that some people are willing to test this current version.
Meanwhile I will look into JCategories to see if I can make this functionality more generic so that other components can use this feature too.

The Category Manager + 4 new columns in Hathor Template:
screen shot 2015-05-12 at 10 24 15


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.
Contributor

pe7er commented May 12, 2015

I've added titles to the hyperlinks under the counters (and changed the language file),
changed column width to 1% because I did not like the layout on a large screen
and added the Article Count to the Hathor template override.

I hope that some people are willing to test this current version.
Meanwhile I will look into JCategories to see if I can make this functionality more generic so that other components can use this feature too.

The Category Manager + 4 new columns in Hathor Template:
screen shot 2015-05-12 at 10 24 15


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.
@woluweb

This comment has been minimized.

Show comment
Hide comment
@woluweb

woluweb May 12, 2015

Hi Martin,

I really like this new feature of article counter in the Category Manager. There was indeed no way to have any overview of the # of articles, be it via the Article Manager or the Category Manager.
Convey my regards to the person who suggested this RFC during that chat with you ;-)
Besides this, I have installed the patch and have already quickly tested (I go on with testing later this week).

So here is the result of my partial test.

  1. First I went to catagory Manager
    It is great !
  1. Then I tried playing from within the Category Manager
    In the following three cases, the counters do disappear (you just come back to the "old non patched" Catagory Manager :
    2.1. sorting by column
    2.2. changing the dropdown filter "show 20 / show all / ..." or "ordering by"
    2.3. clicking on the title of any column to sort
    NB : url in those cases is http://localhost/_debugging/6916/administrator/index.php?option=com_categories&view=categories

Note that, in these three cases, clicking after that on the link "Categories" which is on the left sidebar (cf articles/catagories/featured) leads again to the good layout, with the news columns.
And of course, clicking on the menu Content > Category manager is another way to get back to the new good layout with the three new columns.

This is my very first testing in Joomla, I hope I have been precise enough 😄
Txs for taking the time for this RFC !
I keep you posted as soon as I have done more.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

woluweb commented May 12, 2015

Hi Martin,

I really like this new feature of article counter in the Category Manager. There was indeed no way to have any overview of the # of articles, be it via the Article Manager or the Category Manager.
Convey my regards to the person who suggested this RFC during that chat with you ;-)
Besides this, I have installed the patch and have already quickly tested (I go on with testing later this week).

So here is the result of my partial test.

  1. First I went to catagory Manager
    It is great !
  1. Then I tried playing from within the Category Manager
    In the following three cases, the counters do disappear (you just come back to the "old non patched" Catagory Manager :
    2.1. sorting by column
    2.2. changing the dropdown filter "show 20 / show all / ..." or "ordering by"
    2.3. clicking on the title of any column to sort
    NB : url in those cases is http://localhost/_debugging/6916/administrator/index.php?option=com_categories&view=categories

Note that, in these three cases, clicking after that on the link "Categories" which is on the left sidebar (cf articles/catagories/featured) leads again to the good layout, with the news columns.
And of course, clicking on the menu Content > Category manager is another way to get back to the new good layout with the three new columns.

This is my very first testing in Joomla, I hope I have been precise enough 😄
Txs for taking the time for this RFC !
I keep you posted as soon as I have done more.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

@woluweb

This comment has been minimized.

Show comment
Hide comment
@woluweb

woluweb May 13, 2015

Hi,
Here is a screenshot to illustrate my commentscreen shot 2015-05-13 at 01 32 14


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

woluweb commented May 13, 2015

Hi,
Here is a screenshot to illustrate my commentscreen shot 2015-05-13 at 01 32 14


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

@pe7er

This comment has been minimized.

Show comment
Hide comment
@pe7er

pe7er May 13, 2015

Contributor

Thank you for your test report & description how to reproduce it! I was able to reproduce your findings.

At the moment I check for the com_content component via the URL.
After selecting a filter, the com_content is removed from the URL, hence this behavior.
I've to correct that.

btw: it's Mr Martin, or Peter, but I prefer Peter... 😄


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

Contributor

pe7er commented May 13, 2015

Thank you for your test report & description how to reproduce it! I was able to reproduce your findings.

At the moment I check for the com_content component via the URL.
After selecting a filter, the com_content is removed from the URL, hence this behavior.
I've to correct that.

btw: it's Mr Martin, or Peter, but I prefer Peter... 😄


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

@pe7er

This comment has been minimized.

Show comment
Hide comment
@pe7er

pe7er May 13, 2015

Contributor

I've changed the internal check for com_content from checking via Juri (via URL) to Jinput (checking Requests via URL & Form Input) to solve the issue @woluweb described.
Now the 4 Count Columns will also be displayed after using the filters or order options.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.
Contributor

pe7er commented May 13, 2015

I've changed the internal check for com_content from checking via Juri (via URL) to Jinput (checking Requests via URL & Form Input) to solve the issue @woluweb described.
Now the 4 Count Columns will also be displayed after using the filters or order options.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.
@woluweb

This comment has been minimized.

Show comment
Hide comment
@woluweb

woluweb May 13, 2015

Hum hum, sorry for calling you "Martin" instead of "Pe7er" (I just don't know if I should pronounce it 'pezevener' ;-)
Was a bit tired yesterday evening after the JoomlaDays. But still I wanted to give the feedback asap !

I have tested the very latest version.
I do confirm : the problems I mentionned are totally solved.

I have then tried to be vicious and to find some other weird behaviour, without success 😄

For example :

  • to have all cases, I deleted/archived/unpublished a series or articles. The link of each counter works, whatever the (sub-sub-...)category and whatever the status of the article
  • I even activated the Hathor template (very first time of my life, hopefully the last time) to test. No color in title of column nor in background color of each counter (but that's not a bug, its a feature of Hathor I guess), but it also works

The only think (I think of) which could yet be tested is the more generic version of Category Manager.
Just tell me how to test on that when it's ready and I will be pleased to do so.

Txs for the good & quick work !


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

woluweb commented May 13, 2015

Hum hum, sorry for calling you "Martin" instead of "Pe7er" (I just don't know if I should pronounce it 'pezevener' ;-)
Was a bit tired yesterday evening after the JoomlaDays. But still I wanted to give the feedback asap !

I have tested the very latest version.
I do confirm : the problems I mentionned are totally solved.

I have then tried to be vicious and to find some other weird behaviour, without success 😄

For example :

  • to have all cases, I deleted/archived/unpublished a series or articles. The link of each counter works, whatever the (sub-sub-...)category and whatever the status of the article
  • I even activated the Hathor template (very first time of my life, hopefully the last time) to test. No color in title of column nor in background color of each counter (but that's not a bug, its a feature of Hathor I guess), but it also works

The only think (I think of) which could yet be tested is the more generic version of Category Manager.
Just tell me how to test on that when it's ready and I will be pleased to do so.

Txs for the good & quick work !


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

@pe7er

This comment has been minimized.

Show comment
Hide comment
@pe7er

pe7er May 13, 2015

Contributor

Great! Thanks for testing.
I'll create separate PRs for the different core components: com_banners, com_contact, com_newsfeeds.

Contributor

pe7er commented May 13, 2015

Great! Thanks for testing.
I'll create separate PRs for the different core components: com_banners, com_contact, com_newsfeeds.

@pe7er

This comment has been minimized.

Show comment
Hide comment
@pe7er

pe7er May 13, 2015

Contributor

PR for com_banners: Category manager - banner item count #6934

Contributor

pe7er commented May 13, 2015

PR for com_banners: Category manager - banner item count #6934

@peterlose

This comment has been minimized.

Show comment
Hide comment
@peterlose

peterlose May 13, 2015

Contributor

I'm getting a bunch of notices:

Notice: Use of undefined constant count_published - assumed 'count_published' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 66

Notice: Use of undefined constant count_unpublished - assumed 'count_unpublished' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 71

Notice: Use of undefined constant count_archived - assumed 'count_archived' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 76

Notice: Use of undefined constant count_trashed - assumed 'count_trashed' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 81

Notice: Use of undefined constant count_published - assumed 'count_published' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 189

Notice: Use of undefined constant count_unpublished - assumed 'count_unpublished' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 195

Notice: Use of undefined constant count_archived - assumed 'count_archived' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 201

Notice: Use of undefined constant count_trashed - assumed 'count_trashed' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 207

Notice: Use of undefined constant count_published - assumed 'count_published' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 189

Notice: Use of undefined constant count_unpublished - assumed 'count_unpublished' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 195

Notice: Use of undefined constant count_archived - assumed 'count_archived' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 201

Notice: Use of undefined constant count_trashed - assumed 'count_trashed' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 207

Furthermore the footer td colspan should be updated:

skaermbillede 2015-05-13 kl 21 31 30

Contributor

peterlose commented May 13, 2015

I'm getting a bunch of notices:

Notice: Use of undefined constant count_published - assumed 'count_published' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 66

Notice: Use of undefined constant count_unpublished - assumed 'count_unpublished' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 71

Notice: Use of undefined constant count_archived - assumed 'count_archived' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 76

Notice: Use of undefined constant count_trashed - assumed 'count_trashed' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 81

Notice: Use of undefined constant count_published - assumed 'count_published' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 189

Notice: Use of undefined constant count_unpublished - assumed 'count_unpublished' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 195

Notice: Use of undefined constant count_archived - assumed 'count_archived' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 201

Notice: Use of undefined constant count_trashed - assumed 'count_trashed' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 207

Notice: Use of undefined constant count_published - assumed 'count_published' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 189

Notice: Use of undefined constant count_unpublished - assumed 'count_unpublished' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 195

Notice: Use of undefined constant count_archived - assumed 'count_archived' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 201

Notice: Use of undefined constant count_trashed - assumed 'count_trashed' in /Applications/AMPPS/www/joomla-cms/administrator/components/com_categories/views/categories/tmpl/default.php on line 207

Furthermore the footer td colspan should be updated:

skaermbillede 2015-05-13 kl 21 31 30

@Bakual

This comment has been minimized.

Show comment
Hide comment
@Bakual

Bakual May 13, 2015

Contributor

Did you try with a query like

SELECT `catid`, `state`, count(1) FROM `d1y5s_content` GROUP BY `catid`, `state`

That should give you a resultset grouped by category and state with counts for each of them. You don't even need joins for that. But maybe I miss something.

Also I wouldn't create a new helper file for that. And certainly don't extend JHelperContent since we don't use anything from there.

I would still try to use JCategories and add a generic count method to it (or a specific to the helper).
With JCategories::getInstance($extension) you fetch the JCategories object which already loads the category helper file. The helper file has the table and state field defined in the constructor which is basically all the information we need to fetch the numbers. No need to duplicate that elsewhere.

Contributor

Bakual commented May 13, 2015

Did you try with a query like

SELECT `catid`, `state`, count(1) FROM `d1y5s_content` GROUP BY `catid`, `state`

That should give you a resultset grouped by category and state with counts for each of them. You don't even need joins for that. But maybe I miss something.

Also I wouldn't create a new helper file for that. And certainly don't extend JHelperContent since we don't use anything from there.

I would still try to use JCategories and add a generic count method to it (or a specific to the helper).
With JCategories::getInstance($extension) you fetch the JCategories object which already loads the category helper file. The helper file has the table and state field defined in the constructor which is basically all the information we need to fetch the numbers. No need to duplicate that elsewhere.

@pe7er

This comment has been minimized.

Show comment
Hide comment
@pe7er

pe7er May 13, 2015

Contributor

Thanks @losedk, I'll look into that!

Thanks @Bakual for all you suggestions for improvements!
I'll try to look into your suggestion later to improve my PR.

Contributor

pe7er commented May 13, 2015

Thanks @losedk, I'll look into that!

Thanks @Bakual for all you suggestions for improvements!
I'll try to look into your suggestion later to improve my PR.

@pe7er

This comment has been minimized.

Show comment
Hide comment
@pe7er

pe7er May 14, 2015

Contributor

I've fixed the undefined constant notice + footer td colspan.
Thanks for spotting those @losedk !

Contributor

pe7er commented May 14, 2015

I've fixed the undefined constant notice + footer td colspan.
Thanks for spotting those @losedk !

@pe7er

This comment has been minimized.

Show comment
Hide comment
@pe7er

pe7er May 14, 2015

Contributor

The query

 SELECT `catid`, `state`, count(1) FROM `d1y5s_content` GROUP BY `catid`, `state`

works excellent, @Bakual! It gives all catids + state (or use published if your table uses that) + number of items.

We need to display the numbers in the Categories View. It can be accomplished with some lookup in an array/object for each td field (and if not present, display a 0).

As I need the numbers (including 0) in the records of the categories anyway, I think that my SQL is easier. E.g. if a table (eg com_content) does not have any Archived items, the column with "0" values will be displayed.

However, if your SQL improves the performance (and lookup in the object is faster) then I think we should change that SQL to your suggestion.

Contributor

pe7er commented May 14, 2015

The query

 SELECT `catid`, `state`, count(1) FROM `d1y5s_content` GROUP BY `catid`, `state`

works excellent, @Bakual! It gives all catids + state (or use published if your table uses that) + number of items.

We need to display the numbers in the Categories View. It can be accomplished with some lookup in an array/object for each td field (and if not present, display a 0).

As I need the numbers (including 0) in the records of the categories anyway, I think that my SQL is easier. E.g. if a table (eg com_content) does not have any Archived items, the column with "0" values will be displayed.

However, if your SQL improves the performance (and lookup in the object is faster) then I think we should change that SQL to your suggestion.

@pe7er

This comment has been minimized.

Show comment
Hide comment
@pe7er

pe7er May 14, 2015

Contributor

Ok, thank you all for all feedback!

I have got rid of the extra helper file and moved the SQL to the existing helper file of the component that uses the Category Manager to list its Categories (Thanks @roland-d for your help!)

I've also created/updated separate PRs for
com_banners #6934
com_contact #6938
com_newsfeeds #6936

Contributor

pe7er commented May 14, 2015

Ok, thank you all for all feedback!

I have got rid of the extra helper file and moved the SQL to the existing helper file of the component that uses the Category Manager to list its Categories (Thanks @roland-d for your help!)

I've also created/updated separate PRs for
com_banners #6934
com_contact #6938
com_newsfeeds #6936

@Bakual

This comment has been minimized.

Show comment
Hide comment
@Bakual

Bakual May 14, 2015

Contributor

However, if your SQL improves the performance (and lookup in the object is faster) then I think we should change that SQL to your suggestion.

I'd say a group by should be faster than four joins. But I would have to test it to really verify.

As I need the numbers (including 0) in the records of the categories anyway, I think that my SQL is easier. E.g. if a table (eg com_content) does not have any Archived items, the column with "0" values will be displayed.

That's a good point. Could be tricky to detect which states the extension uses. Your solution is indeed easier for that.

Contributor

Bakual commented May 14, 2015

However, if your SQL improves the performance (and lookup in the object is faster) then I think we should change that SQL to your suggestion.

I'd say a group by should be faster than four joins. But I would have to test it to really verify.

As I need the numbers (including 0) in the records of the categories anyway, I think that my SQL is easier. E.g. if a table (eg com_content) does not have any Archived items, the column with "0" values will be displayed.

That's a good point. Could be tricky to detect which states the extension uses. Your solution is indeed easier for that.

@hans2103

This comment has been minimized.

Show comment
Hide comment
@hans2103

hans2103 May 14, 2015

Contributor

@test succes

Tested both desktop and mobile.
Looks great.
Useful PR for doing housecleaning and detecting empty categories.

Contributor

hans2103 commented May 14, 2015

@test succes

Tested both desktop and mobile.
Looks great.
Useful PR for doing housecleaning and detecting empty categories.

@woluweb

This comment has been minimized.

Show comment
Hide comment
@woluweb

woluweb May 19, 2015

On I have tested further : indeed, on issue #6934 (count for BANNERS), I noticed that clicking on "zeros" would still show all banners of the category, no matter their "status".
But apparently, this little bug only occurs for com_banners (works fine for the current RFC com_content, and also for com_contact and com_newsfeed)


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

woluweb commented May 19, 2015

On I have tested further : indeed, on issue #6934 (count for BANNERS), I noticed that clicking on "zeros" would still show all banners of the category, no matter their "status".
But apparently, this little bug only occurs for com_banners (works fine for the current RFC com_content, and also for com_contact and com_newsfeed)


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.
@tecpromotion

This comment has been minimized.

Show comment
Hide comment
@tecpromotion

tecpromotion May 30, 2015

Contributor

tested successfully. #jab15


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

Contributor

tecpromotion commented May 30, 2015

tested successfully. #jab15


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

@zero-24 zero-24 added the RTC label May 31, 2015

@Bakual Bakual added this to the Joomla! 3.5.0 milestone Jun 3, 2015

@Bakual

This comment has been minimized.

Show comment
Hide comment
@Bakual

Bakual Jun 3, 2015

Contributor

Merged with c57e644 into 3.5-dev.
Solved a small merge conflict on the way.

Thanks!

Contributor

Bakual commented Jun 3, 2015

Merged with c57e644 into 3.5-dev.
Solved a small merge conflict on the way.

Thanks!

@infograf768

This comment has been minimized.

Show comment
Hide comment
@infograf768

infograf768 Nov 3, 2015

Member

@pe7er @Bakual
In Hathor, we get the Notices as explained above:
#6916 (comment)

screen shot 2015-11-03 at 07 54 23

This needs correcting or going back in Hathor to the former display.

Member

infograf768 commented Nov 3, 2015

@pe7er @Bakual
In Hathor, we get the Notices as explained above:
#6916 (comment)

screen shot 2015-11-03 at 07 54 23

This needs correcting or going back in Hathor to the former display.

@infograf768

This comment has been minimized.

Show comment
Hide comment
@infograf768

infograf768 Nov 3, 2015

Member

Found the culprit, now making a PR

Member

infograf768 commented Nov 3, 2015

Found the culprit, now making a PR

@infograf768

This comment has been minimized.

Show comment
Hide comment
@infograf768

infograf768 Nov 3, 2015

Member

See PR here: #8254

Member

infograf768 commented Nov 3, 2015

See PR here: #8254

@pe7er pe7er deleted the pe7er:category-manager-article-count branch Nov 5, 2015

@Wertos

This comment has been minimized.

Show comment
Hide comment
@Wertos

Wertos Mar 12, 2016

The site of about 85,000 materials and 100 categories. In the transition to the category management page opens a minute. There is possible to disable counting?

Wertos commented Mar 12, 2016

The site of about 85,000 materials and 100 categories. In the transition to the category management page opens a minute. There is possible to disable counting?

@roland-d

This comment has been minimized.

Show comment
Hide comment
@roland-d

roland-d Mar 12, 2016

Contributor

@Wertos There is no clean way at the moment to disable the counting but a quick hack would be to change the name countItems in administrator/components/com_content/helpers/content.php to something else. This is a core-hack and not recommended. @pe7er Perhaps we should add a switch for turning it on/off or find out why it takes so long? Are we missing an index?

Contributor

roland-d commented Mar 12, 2016

@Wertos There is no clean way at the moment to disable the counting but a quick hack would be to change the name countItems in administrator/components/com_content/helpers/content.php to something else. This is a core-hack and not recommended. @pe7er Perhaps we should add a switch for turning it on/off or find out why it takes so long? Are we missing an index?

@wilsonge

This comment has been minimized.

Show comment
Hide comment
@wilsonge

wilsonge Mar 13, 2016

Contributor

@Wertos @roland-d can you guys please open a new issue for this so I can keep track of it please - nearly missed this tucked away in an old issue. Thanks!

Contributor

wilsonge commented Mar 13, 2016

@Wertos @roland-d can you guys please open a new issue for this so I can keep track of it please - nearly missed this tucked away in an old issue. Thanks!

@pe7er

This comment has been minimized.

Show comment
Hide comment
@pe7er

pe7er Mar 14, 2016

Contributor

@Wertos Thanks for reporting this issue.
@roland-d I'll try to look at this issue at the end of this week.

Contributor

pe7er commented Mar 14, 2016

@Wertos Thanks for reporting this issue.
@roland-d I'll try to look at this issue at the end of this week.

@brianteeman

This comment has been minimized.

Show comment
Hide comment
@brianteeman

brianteeman Mar 14, 2016

Contributor

I am in the process of building a site with 80,000 in over 1000 categories
for testing - but it is taking a while to generate - 2 hours so far and
only half way there

On 14 March 2016 at 11:58, Peter Martin notifications@github.com wrote:

@Wertos https://github.com/Wertos Thanks for reporting this issue.
@roland-d https://github.com/roland-d I'll try to look at this issue at
the end of this week.


Reply to this email directly or view it on GitHub
#6916 (comment).

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

Contributor

brianteeman commented Mar 14, 2016

I am in the process of building a site with 80,000 in over 1000 categories
for testing - but it is taking a while to generate - 2 hours so far and
only half way there

On 14 March 2016 at 11:58, Peter Martin notifications@github.com wrote:

@Wertos https://github.com/Wertos Thanks for reporting this issue.
@roland-d https://github.com/roland-d I'll try to look at this issue at
the end of this week.


Reply to this email directly or view it on GitHub
#6916 (comment).

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

@brianteeman

This comment has been minimized.

Show comment
Hide comment
@brianteeman

brianteeman Mar 14, 2016

Contributor

@pe7er @Wertos @roland-d please see #9420 and continue the discussion there and not on this closed issue


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

Contributor

brianteeman commented Mar 14, 2016

@pe7er @Wertos @roland-d please see #9420 and continue the discussion there and not on this closed issue


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6916.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment