backdrop-issues icon indicating copy to clipboard operation
backdrop-issues copied to clipboard

The code shown for callback_batch_operation() calls a function that Backdrop core does not implement

Open avpaderno opened this issue 7 months ago • 2 comments

callback_batch_operation() contains the following code.

  while ($row = db_fetch_array($result)) {

    // Here we actually perform our processing on the current node.
    $node = node_load($row['nid'], NULL, TRUE);
    $node->value1 = $options1;
    $node->value2 = $options2;
    node_save($node);

    // Store some result for post-processing in the finished callback.
    $context['results'][] = check_plain($node->title);

    // Update our progress information.
    $context['sandbox']['progress']++;
    $context['sandbox']['current_node'] = $node->nid;
    $context['message'] = t('Now processing %node', array('%node' => $node->title));
  }

Backdrop core does not implement any db_fetch_array() function, which is instead implemented in Drupal 6.

The code shown for that callback needs to be updated to use only functions Backdrop core has.

This is the equivalent of callback_batch_operation() code still contains Drupal 6 code I reported for Drupal 8.

avpaderno avatar Jun 29 '24 10:06 avpaderno