i just installed the module on a site with 81 Page nodes and 4 Book nodes. on the index page for Pages, it says "There are 7290 Page nodes" at the top and "There are 81 unclassified Page nodes." at the bottom. on the index page for Book pages, it says "There are 360 Book page nodes." at the top and "There are 4 unclassified Book page nodes." at the bottom. For some reason the counts are off by a factor of 90.

i dug around a bit and found that removing ", {node_access} na" from line 236 of indexpage.module causes the counts to be correct, though i'm not sure why. i looked at the node_access table in my database and it has 30 rows.

Comments

nancydru’s picture

Each row in node_access can grant access to almost every node in your system. I added that because someone complained that it wasn't working right when they had an access control module. Maybe it would be better with it backed out.

markabur’s picture

yeah, it seems like it's there for a good reason :-)

i checked again and realized i was reading phpmyadmin incorrectly -- it did have 90 rows. now it has 93 rows and the counts are off by a factor of 93 (for the admin. when i log in as a more limited user the counts are off by a factor of 89).

unfortunately i don't know anything about access control, so i can't help you there, but i'm trying to picture how adding that helped. it feels like a different type of join would fix the counts but still work for the other issue?

nancydru’s picture

Status: Active » Needs review

Okay, let's start with this: At line 254, please change

    $exist_type = @db_result(db_query(_indexpage_check_status("SELECT COUNT(n.type) FROM {node} n, {node_access} na WHERE n.type = '%s'") . ($access ? ' AND '. $access : ''), arg(1)));

To:

    $exist_type = @db_result(db_query(_indexpage_check_status("SELECT COUNT(DISTINCT(n.nid)) FROM {node} n, {node_access} na WHERE n.type = '%s'") . ($access ? ' AND '. $access : ''), arg(1)));
nancydru’s picture

Assigned: Unassigned » nancydru
Status: Needs review » Fixed

I went ahead and committed this.

markabur’s picture

works great, thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.