Posted on: 10/04/03 11:27am
By: zilch
A user pointed out an oddity to me today tha I can't seem to track a fix to.
The submissions counter doesn't seem to go up when new stories are posted for approval. Oddly enough, new links and Events do increment the counter in the admin menu.
Does anyone have any ideas why the Admin menu Submissions counter would work for some submissions but not for Stories?
Thanks for any help you can provide.
Re:Submissions Counter Not working??
Posted on: 10/04/03 12:12pm
By: Dirk
[QUOTE BY= zilch]Does anyone have any ideas why the Admin menu Submissions counter would work for some submissions but not for Stories?[/QUOTE]
Does it happen for the site Admin or for a Story Admin? The submission counter honors the permission system. So if a story is submitted for a topic that the Story Admin doesn't have access to, it won't be counted (for that Story Admin).
bye, Dirk
Re:Submissions Counter Not working??
Posted on: 10/04/03 10:00pm
By: zilch
Dirk, I am the site admin and I posted a few stories as a "Test user" with no admin rights. When I logged back in as Site Admin, I got a big 0 next to Submissions.
Re:Submissions Counter Not working??
Posted on: 10/05/03 04:29am
By: Dirk
[QUOTE BY= zilch] When I logged back in as Site Admin, I got a big 0 next to Submissions. [/QUOTE]
But the submissions were there?
bye, Dirk
Re:Submissions Counter Not working??
Posted on: 10/05/03 08:20am
By: Anonymous (zilch)
Yes, the submissions where awaiting approval like normal. There is just no alert that the new stories exist.
Re:Submissions Counter Not working??
Posted on: 12/23/03 12:41am
By: Anonymous (Maximus)
I am also having this problem, none of the admins or editors are seeing the counter next to the submissions entry as anything other than (0), but submissions are present on the submissions page. It has been tested with all combo's of permissions posting (took the entire staff of 3 a few hours).
We have a large number of plugins, including the menu plugin, which required a replacement search.php file. I do not think we modified any other stock GL files.
also, we are getting emailed notice of anything submitted.
If you could tell me where the function for this counter lives, and what other functions it relies upon to get the counter number, I'd be very happy to go bug hunting myself.
--maximus co-admin darja.net.
Re:Submissions Counter Not working??
Posted on: 12/23/03 01:40am
By: Anonymous (maximus)
Solved it. When using the most recent version of the menu plugin, you will never have the submissions counter say anything other than (0), except with a membership submission.
Why? Glad you asked.
For some reason, they have reproduced the admin block function in lib-common in thier functions.inc file in the GL/plugins/menu folder. It has an error.
Starting in the neighborhood of line 509, and I have maintained the code I snipped in the comments on these lines to show the difference. As the code appears here, the counter seems to behave properly.
$num = 0;
if( SEC_hasrights( 'story.edit' ))
{
$num += DB_count( $_TABLES['storysubmission'] ); //, 'uid', 0 );
}
if( SEC_hasrights( 'event.edit' ))
{
$num += DB_count ($_TABLES['eventsubmission'] ); //, 'eid', 0);
}
if( SEC_hasrights( 'link.edit' ))
{
$num += DB_count( $_TABLES['linksubmission']); //, 'lid', 0 );
}
if( SEC_hasrights( 'user.edit' ) && SEC_hasrights( 'user.delete' ))
{
$emptypwd = md5( '' );
$num += DB_count( $_TABLES['users'], 'passwd', $emptypwd );
}
The db calls were not correct. Could someone call them and let them know to replace these functions with calls to lib-common, or update them?
Thanks
--maximus co-admin of darja.net