Not sure this is bug a but I thought I'd ask... In update_authorize_batch_copy_project():

    $context['#finished'] = 1;

and a few lines later

  $context['finished'] = 1;

If this is not a bug, it's at least a rather obscure use of variable names.

CommentFileSizeAuthor
#4 955146_4_context_finished.patch481 bytesscor

Comments

yched’s picture

That's a bug - should be $context['finished'] = 1;
Care to roll a patch ?

scor’s picture

Rolling a patch is not a problem. I guess all these have to be fixed too:

includes/update.inc:415:    $sandbox['#finished'] = $sandbox['progress'] / $sandbox['max'];
includes/update.inc:890:  if (isset($context['sandbox']['#finished'])) {
includes/update.inc:891:    $context['finished'] = $context['sandbox']['#finished'];
includes/update.inc:892:    unset($context['sandbox']['#finished']);
modules/comment/comment.install:313:    $sandbox['#finished'] = 1 - count($sandbox['types']) / $sandbox['total'];
modules/node/node.install:552:  $sandbox['#finished'] = 0;
modules/node/node.install:723:      $sandbox['#finished'] = min(0.99, $sandbox['count'] / $sandbox['total']);
modules/node/node.install:739:      $sandbox['#finished'] = 1;
modules/system/system.api.php:3011: * information between successive calls, and the $sandbox['#finished'] value
modules/system/system.api.php:3067:  $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']);
modules/system/system.install:2871:    $sandbox['#finished'] = $sandbox['progress'] / $sandbox['max'];
modules/taxonomy/taxonomy.install:713:    $sandbox['#finished'] = FALSE;
modules/taxonomy/taxonomy.install:720:    $sandbox['#finished'] = TRUE;
modules/user/user.install:407:  $sandbox['#finished'] = 0;
modules/user/user.install:435:    $sandbox['#finished'] = $sandbox['user_from']/$sandbox['user_count'];
modules/user/user.install:438:      $sandbox['#finished'] = 1;
modules/user/user.install:460:  $sandbox['#finished'] = 0;
modules/user/user.install:518:    $sandbox['#finished'] = $sandbox['user_from'] / $sandbox['user_count'];
modules/user/user.install:793:  $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']);
modules/user/user.install:797:  if (isset($sandbox['#finished']) && $sandbox['#finished'] == 1) {
modules/user/user.install:828:  $sandbox['#finished'] = empty($sandbox['max']) || ($sandbox['progress'] / $sandbox['max']);
yched’s picture

nope, $context['#finished'] is wrong, but $sandbox['#finished'] is OK - that's a construct added by update.php for update functions.

scor’s picture

Status: Active » Needs review
StatusFileSize
new481 bytes

ok.

yched’s picture

Status: Needs review » Reviewed & tested by the community

Thks !

scor’s picture

Title: $context['#finished'] vs $context['finished'] » $context['#finished'] should be $context['finished']

better title now that this has been confirmed as a bug.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

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