I have a rule as follows:

1. Fetch all nodes of type X (fetched_nodes)
2. Loop over all fetched nodes (list_item)
2a. Show a message on the site: [list-item:title]
3. Page redirect to /

This works fine using a normal loop, but if I use a batch loop instead, the loop never runs, it just does the page redirect and nothing else.

I tried using patch #2 from Rules batch (sometimes) does not start (2225395) but this caused the batch loop to run over and over again non-stop.

CommentFileSizeAuthor
#3 rules_batch.patch1.38 KBalansaviolobo

Comments

qdoscc created an issue. See original summary.

delacosta456’s picture

hi
please have you found a solution ?

i am having infinite loop too .

alansaviolobo’s picture

Assigned: Unassigned » alansaviolobo
Status: Active » Needs review
StatusFileSize
new1.38 KB

Added a option to enter the redirect url on the batch loop along with the array being iterated on.

alansaviolobo’s picture

The following would be required for features integration but this part doesnt appear to work as expected.

  public function label() {
    return !empty($this->label) ? $this->label : t('Batch Loop');
  }
//start here
  protected function exportSettings() {
    $export = parent::exportSettings();
    $export['REDIRECT_PATH'] = $this->settings['redirect_path'];
    return $export;
  }

  protected function importSettings($export) {
    parent::importSettings($export);
    if (isset($export['REDIRECT_PATH'])) {
      $this->settings['redirect_path'] = $export['REDIRECT_PATH'];
    }
  }
//end here
}

  • alansaviolobo committed a84bf8d on 7.x-1.x
    Issue #2766829 by alansaviolobo: Does not work with Page Redirect action
    
alansaviolobo’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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