only first user (administrator) can add minutes

richard.e.morton - October 26, 2008 - 09:46
Project:Minutes
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:pukku
Status:active
Description

Hi,

I have a large site (www.plusgroups.org.uk) and unfortunately only the site administrator can add the event review/meeting minutes to the event. This is most unfortunate as the real purpose of a technology like drupal is to split up the work load...

Help!

thanks
Richard

#1

pukku - October 27, 2008 - 20:11

please verify that the roles in question have the "create minutes" permission, as well as permission to access the event nodes that the minutes are for. The "create minutes" permission is located under the minutes module, not under the node module.

#2

richard.e.morton - November 17, 2008 - 20:03

Hi There,

Sorry for the long delay, yes I can confirm that the users have the required permissions. In fact I have an adminstrator role with virtually all permissions and yet those people cannot add minutes to events.

Thanks

Richard

#3

pukku - December 9, 2008 - 20:38
Assigned to:Anonymous» pukku

Hi! A bunch of questions...

Have you rebuilt access control permissions?

Do you have the devel module installed? If so, could you turn on the devel_node_access module, and tell me what it shows for an event node?

If you have the devel module installed, are you comfortable with editing files? If so, there are some debugging steps I would like you to take...

Ricky

#4

richard.e.morton - December 15, 2008 - 23:26

Hi There,

Sorry for the late reply, I've been knocked out for a few days with Flu.

I have rebuilt permissions but this hasn't helped.

I don't have the devel module installed but if it will help I can install it, I guess it's not a good idea to install it on the live site, so I'll build a dev site and install it there if you would like me to.

thanks

Richard
Plus! Multi Activity clubs in the UK

#5

pukku - December 16, 2008 - 16:15

FWIW, I do install the devel module on my live sites because you can restrict access to it by roles, so I only let a "superadmin" role have access. It's useful occasionally because of the execute PHP block, which allows you to make some complicated things happen. Also, you would only need it for a short while. But if you're still uncomfortable, it would be useful to have a test site we can play with (although I think you won't have this problem on the test site...).

However, first:

Do the users see the link "post minutes for this event" when viewing an event node that has minutes enabled for it?

Is CCK enabled, and have you modified the minutes node type with CCK?

If you grab the nid of an event with no minutes, and go to node/add/minutes/(nid) (ie, replace the (nid) with the nid of the event, do you get the add minutes form?

Ricky

#6

richard.e.morton - December 21, 2008 - 17:14

Hi Pukku,

Right I have installed Devel. What settings would you like me to use for Devel and from what page and how do I get to that data. In answer to your other questions:

Do the users see the link "post minutes for this event" when viewing an event node that has minutes enabled for it?

Nope, but they do see the read minutes if there are some posted

Is CCK enabled, and have you modified the minutes node type with CCK?

yes it is installed, but no, no modifications to the minutes node.

If you grab the nid of an event with no minutes, and go to node/add/minutes/(nid) (ie, replace the (nid) with the nid of the event, do you get the add minutes form?

nope, access denied.

thanks R

#7

pukku - December 23, 2008 - 16:21

OK, now that Devel is installed:

1. enable the Devel module.
2. In minutes.module function minutes_link, alter the lines:

<?php
 
elseif (($type == 'node') and (minutes_type_is_enabled($node->type))) {
   
// this is an event of some type, so provide a link to either
    // create or view the minutes
   
    // are there minutes for this node already?
   
$minutes_nid = db_result(db_query("SELECT nid FROM {minutes} WHERE event_id = %d", $node->nid));
    if (
user_access('create minutes') and (is_null($minutes_nid) or ($minutes_nid == ''))) {
     
$links['minutes_post'] = array('title' => t('post minutes for this event'), 'href' => "node/add/minutes/$node->nid");
    }
?>

to include a call to dvm(), so that it looks like this:

<?php
 
elseif (($type == 'node') and (minutes_type_is_enabled($node->type))) {
   
// this is an event of some type, so provide a link to either
    // create or view the minutes
   
    // are there minutes for this node already?
   
$minutes_nid = db_result(db_query("SELECT nid FROM {minutes} WHERE event_id = %d", $node->nid));
   
dvm(user_access('create minutes'), 'user can create minutes'); // ********* ADDED
   
dvm($minutes_nid, 'extant minutes nid'); // *********** ADDED
   
if (user_access('create minutes') and (is_null($minutes_nid) or ($minutes_nid == ''))) {
     
dpm('adding minutes link'); // ************ ADDED
     
$links['minutes_post'] = array('title' => t('post minutes for this event'), 'href' => "node/add/minutes/$node->nid");
    }
?>

3. Create a new role (probably called "developer", or something similar) with the permission "access devel information" and give it to a user who is having this problem.

4. Go to an event and you should see a bunch of information in the messages box above the content. Please post what you find there...

Thanks,
Ricky

 
 

Drupal is a registered trademark of Dries Buytaert.