Does scheduled task works using private nodes as arguments?
I have a issue queue. When a node field is marked as "waiting", if it doesn't change its state to "solved" in 7 days I want to recive an email. So I created a "task set" which should take a "non public" node and check its status, if marked as "waiting" it sends an email; and a triggered rule so, when a node is edited, it schedules the "task set" to "+ 7 days".

Does it work out of the box, or because of cron running as "anonymous" the node will not be avaliable? Or should I modify the scheduled task to be called between:

function mymodule_su($uid = 1) {
  global $user;
  if (!array_key_exists('mymodule_su', $_SESSION)) {
    $_SESSION['mymodule_su'] = array();
  }
  array_push($_SESSION['mymodule_su'], $user);
  session_save_session();
  $user = user_load($uid);
}

function mymodule_unsu() {
  global $user;
  if (array_key_exists('mymodule_su', $_SESSION)) {
    if (!empty($_SESSION['mymodule_su'])) {
      $user = array_pop($_SESSION['mymodule_su']);
    }
    if (empty($_SESSION['mymodule_su'])) {
      unset($_SESSION['mymodule_su']);
    }
  }
}

using the "uid" of the user who triggered the rule?

Comments

tr’s picture

Issue summary: View changes
Status: Active » Closed (outdated)