Download & Extend

Scheduler on publish is not triggering rules

Project:Scheduler
Version:6.x-1.3
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Or so it seems.

I have a set of rules (the rules project) that will forcefully publish children nodes when a particular parent node is published and unpublish the children nodes when the parent gets unpublished.

The nodes themselves are associated by node_reference+cck.

The rule in question perform a php action that calls a view.
Here is the code:

<?php
  $view
= views_get_view('children_of_parent', TRUE);

  if (
is_object($view)) {
   
$view->set_display('default');
   
$view->set_arguments(array($node->nid));
   
$view->render();

    foreach (
$view->result as $result) {
     
$current_node = node_load($result->nid);
     
$actions = array('node_publish_action', 'node_save_action');
     
$context['node'] = $current_node;
     
actions_do($actions, $current_node, $context, NULL, NULL);
    }
  }
?>

The owner of the parent node does not and must not have any permissions to edit or change the children nodes.
The children nodes are created by completely different users without edit access to the parent node.

By itself when I click publish and unpublish on the parent node, as the appropriate user, the parent gets published, the rule properly fires and all of the children appropriately get published (or unpublished) as necessary.

However, when I use the scheduler to publish the parent node, only the parent node gets published.
As far as I can tell, the rule to publish the children never fires.

Very interestingly, when I have scheduler unpublish nodes, the rule _does_ get fired and the children nodes _do_ get unpublished.

This means that somehow the scheduler publish is not triggering the rule while the scheduler unpublish is.

The only thing I can seem to think about is that perhaps this is a permissions problem as the owner of the node doing the publishing has no ability to view or edit the unpublished children.
Contrary to my previous sentence, when the owner of the node does a non-scheduler publish, the children of the nodes the owner cannot access or edit unpublished do get published.

Comments

#1

Scheduler is firing the 'node_publish_action' and 'node_save_action' for publishing a node and 'node_unpublish_action' and 'node_save_action' for unpublishing.

Could you please file an issue against the rules module and point them back here for reference? I never used the rules and node_reference modules so I cannot help you with this. All I know is that the mechanisms for publishung an unpublishing in scheduler 6.x are pretty straight forward.

#2

Status:active» postponed

Rules modules issue: #460364: Publishing not always working, something to do with permissions?

#3

Status:postponed» fixed

This is worked at in rules land (see link in #2)...

#4

Status:fixed» closed (fixed)

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

nobody click here