ProcessWire icon indicating copy to clipboard operation
ProcessWire copied to clipboard

Tree count (Home) is wrong for an editor

Open cb2004 opened this issue 9 years ago • 10 comments

The page count next to the home page is wrong if you are not a superuser and seems to be +1 on all my sites.

cb2004 avatar Nov 18 '15 15:11 cb2004

I'm not seeing that here. Can you show me a screenshot of what you are seeing and in what version of PW?

ryancramerdesign avatar Nov 19 '15 11:11 ryancramerdesign

Sure thing Ryan.

Superuser:

superuser

Editor:

editor

PW 2.7.0 but I have seen it for a while in 2.6.x

cb2004 avatar Nov 19 '15 14:11 cb2004

Your count for superuser there is correct. Trash is technically a page, though debatable whether it should be counted as one in this context. But what you are seeing for Editor doesn't look correct. I'm not exactly sure how to reproduce that one, as I'm not seeing the same thing here on a fresh install. Do you have any other modules installed that might be manipulating the PageList? I'm also wondering why the 404 page isn't showing for your Editor role?

On Thu, Nov 19, 2015 at 9:19 AM, cb2004 [email protected] wrote:

Sure thing Ryan.

Superuser:

[image: superuser] https://cloud.githubusercontent.com/assets/6205980/11272923/300d60e2-8ec8-11e5-90a6-a9eed5bfdf3e.gif

Editor:

[image: editor] https://cloud.githubusercontent.com/assets/6205980/11272968/7beed810-8ec8-11e5-961c-db737f2ac071.gif

PW 2.7.0 but I have seen it for a while in 2.6.x

— Reply to this email directly or view it on GitHub https://github.com/ryancramerdesign/ProcessWire/issues/1514#issuecomment-158070864 .

ryancramerdesign avatar Nov 19 '15 15:11 ryancramerdesign

Yes superuser count is fine. Editer is not. And that is the same for every PW install I have, it is always +1. This is even with a fresh install.

None of my editors can see the 404 page in the tree in any of my installs, I asked about that recently in the forums:

https://processwire.com/talk/topic/10877-404-page-should-be-optional-for-the-page-tree/#entry102233

I thought that was default behaviour? Although if an editor can edit the 404 page if it shows up in the 'Recent' section or if they go to the ID of the page in admin.

cb2004 avatar Nov 19 '15 15:11 cb2004

Sorry, I wasn't thinking. The 404 page shouldn't show up there since it is a system page, so that's definitely not it (yes they can still edit it if they know where to go and have permission to do so). What permissions does your Editor role have?

In my test install, my Editor role has page-edit, page-lister, page-view (of course), and profile-edit. I have assigned them edit permission for the basic-page template, but no others.

To test further, I took the sitemap template (which is used by the site-map page, child of homepage) and removed view access from that. But the count did update correctly. I'm guessing the answer lies somewhere in the permission settings for the role, but may need to still keep asking questions till we find it. :)

On Thu, Nov 19, 2015 at 10:10 AM, cb2004 [email protected] wrote:

Yes superuser count is fine. Editer is not. And that is the same for every PW install I have, it is always +1. This is even with a fresh install.

None of my editors can see the 404 page in the tree in any of my installs, I asked about that recently in the forums:

https://processwire.com/talk/topic/10877-404-page-should-be-optional-for-the-page-tree/#entry102233

I thought that was default behaviour? Although if an editor can edit a page if it shows up in the 'Recent' section or if they go to the ID of the page in admin.

— Reply to this email directly or view it on GitHub https://github.com/ryancramerdesign/ProcessWire/issues/1514#issuecomment-158084592 .

ryancramerdesign avatar Nov 19 '15 15:11 ryancramerdesign

They have page-edit (which includes page-add, page-create), page-view, profile-edit

cb2004 avatar Nov 19 '15 15:11 cb2004

Are there any other 3rd party modules installed, or do you have any custom hooks in play? You might try enabling debug mode, then clicking "debug mode tools > hooks" at the bottom and seeing if anything is hooking to Page::listable. The children counts that you see don't take hooks into account, so they could show the wrong number if a Page::listable hook is returning false, and that would be expected.

Outside of that, is this something I can login to (PW admin) to take a closer look? If so, please PM me login info to 'ryan' in the ProcessWire forums at https://processwire.com/talk/

ryancramerdesign avatar Nov 23 '15 11:11 ryancramerdesign

No 3rd party modules, no custom hooks. I will PM you a login no problem.

cb2004 avatar Nov 24 '15 18:11 cb2004

@cb2004 What’s the status of this issue? Can it be closed?

isellsoap avatar Sep 30 '16 13:09 isellsoap

@isellsoap @ryancramerdesign I think it is still a bug to do with the 404 page. If the editor has edit permissions on the template that the 404 pages uses then the count is ok. If the editor doesn't have edit permissions then the count is 1 too many.

cb2004 avatar Sep 30 '16 13:09 cb2004