From 0.4a, at around line 122 (theme_hosting_task_migrate_form()):

  foreach ($packages as $platform => $package_instances) {
    $row = array();
    foreach ($packages[$node->platform] as $key => $platform_instance) {
      if ($instance = $package_instances[$key]) {
        $comparison = hosting_package_instance_version_compare($platform_instance, $instance);
        $display = $instance->version;
        if ($instance->schema_version) {
          $display .= " (" . $instance->schema_version . ")";
        }
        if ($comparison > 0) {
          $row[] = array('class' => 'hosting-package-upgrade', 'data' => $display);
        }
        elseif ($comparison == 0) {
          $row[] = array('class' => 'hosting-package-same', 'data' => $display);
        }
        else {
          $row[] = array('class' => 'hosting-package-downgrade', 'data' => $display);
          $error = TRUE;
        }
      }

Background: I was unable to migrate any sites, despite the fact that at least one platform was returning no errors.

Problem: It looks like there's a logic error in the task_migrate form for errors. See line 139 -

$error = TRUE;

Since this is inside a FOREACH, $error = FALSE; needs to be declared at the beginning of the FOREACH, otherwise any row that comes after one that has an error will have an error as well. Please see my suggested patch, attached.

Thanks!
-pl

CommentFileSizeAuthor
hosting_migrate.patch518 bytesphillamb168

Comments

adrian’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

I am committing a change that completely refactors that module, since the logic is completely different I am unsure if this issue still applies.

If you could test with the new form I would appreciate it.

#583844: Refactor the package comparison user interface

thanks for the contribution.

omega8cc’s picture

When patch from @adrian is applied, then patch from @phillamb168 fails and is not needed.

Now it works and finally the package comparison user interface is clean when you have more than 2-3 platforms.

Thanks!

~Grace

anarcat’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)