Closed (won't fix)
Project:
Workspace
Version:
4.6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
3 Jun 2005 at 08:44 UTC
Updated:
14 Jul 2009 at 14:48 UTC
Environment: Drupal 4.6, Apache 1.3.x, PHP 4.3.x, MySQL 4
cvs header: $Id: workspace.module,v 1.16 2005/02/23 15:32:18 jvandyk Exp $
I do not have node permissions module installed.
When I reached 24 nodes, the count returned by:
$count_sql = 'SELECT COUNT(n.nid) + COUNT(c.cid) FROM '. implode(', ', $node_from) .' '. implode(' ', $node_join) .' LEFT JOIN {comments} AS c ON c.uid = '. db_escape_string($user->uid). ' WHERE '. implode(' ', $node_where);
... claimed I had 88 nodes! This is incorrect. Several test nodes later the result was higher, 29 vs. 102 I think. Also incorrect. I am not very SQL-smart, so after four hours of getting nowhere trying to make it work, I gave up and wrote a work-around that uses a UNION to get counts from the node and comments tables (more or less) independently. I justify using UNION because MySQL 4 is already a requirement of this module. Please see the attached patch.
| Comment | File | Size | Author |
|---|---|---|---|
| workspace.4-6.sql_count-workaround.patch | 4 KB | Travis |
Comments
Comment #1
jvandyk commentedIf this can be done more cleanly (i.e., as a modification to a query rather than with a hack) I will apply it.
Comment #2
Péter Cseke commentedHow about changing:
into
Only the $count_sql=... line is changed. This works for me, and it should work with nodeperm_role as well.
Comment #3
frank ralf commentedPertains to an outdated version. Please create new issue if problem persists.
TIA
Frank