Closed (won't fix)
Project:
Hosting
Version:
6.x-0.4-alpha1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Sep 2009 at 18:22 UTC
Updated:
23 Sep 2009 at 15:31 UTC
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
| Comment | File | Size | Author |
|---|---|---|---|
| hosting_migrate.patch | 518 bytes | phillamb168 |
Comments
Comment #1
adrian commentedI 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.
Comment #2
omega8cc commentedWhen 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
Comment #3
anarcat commented