Helo People, When i assign any task to some user, and this user change the Status field and Save the To_do node i get this message:

Access Denied

warning: Invalid argument supplied for foreach() in C:\AppServ\www\to_do\sites\all\modules\to_do\to_do_rules.module on line 7.
To do Task1 has been updated.
You are not authorized to access this page.

The Asigned User has not access to the To_Do task after editing to it.
¿Is There a form to redirect to other path o to My To Do List?

Thanks Very Much.
PD: Tomorrow Start with the project translation!
PD: If i want translate this module do i need any permission on the Translation Team?

Comments

AlexisWilke’s picture

dvasquez,

I don't know much about the new translation system. You may have to get a translator account or something like that...

Does this happen when the user removes himself from the list of attached users, or just the act of saving will remove him from the list?

The error itself, in the rules module, would be easy to fix by testing whether the list of assigned users is empty(). If so, then avoid the foreach(). However, that may be hiding the real problem.

Thank you.
Alexis

function to_do_rules_trigger($op, $node) {
  // call the event once per assigned user
  // (we assume that $node was properly loaded.)
  if (!empty($node->assigned_users)) {
    foreach ($node->assigned_users as $uid => $name) {
      // load the user since we want the signal to include
      // a full user object (so it can be used as such.)
      $assigned_user = user_load(array('uid' => $uid));
      if ($assigned_user) {
        rules_invoke_event($op, array('node' => $node, 'assigned_user' => $assigned_user));
      }
    }
  }
}
AlexisWilke’s picture

Assigned: Unassigned » AlexisWilke
Status: Active » Fixed

Okay, that should be fixed. There was a case when you'd update or insert a node where the assigned users wouldn't be properly assigned.

I'll mark this as fixed, it will be in 1.6. If you still have that problem with 6.x-1.x-dev or 1.6, then feel free to reopen the issue.

Thank you.
Alexis Wilke

Status: Fixed » Closed (fixed)

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