Hi guys,
There is a bug in the D6 version and the D7 version in regard to generating the list.
Drupal 7.x
In D7, you now create an array of list items and then create the list with an implode and put all of that inside a pair of <ul> </ul>. Then 2 lines below you kept the close tag as follow:
if ($messages) {
$output .= '<h4>Update #' . $number . "</h4>\n";
$output .= '<ul>' . implode("\n", $messages) . "</ul>\n";
}
}
$output .= '</ul>';
That last line is spurious.
Drupal 6.x
In the D6 version, you open and close properly except when you hit a '#abort' in which case you close, close, close...
There is the code and as you can see the $output .= '</ul>';
is after the close } of the if ($number != '#abort') {
which means it is added when '#abort' is found. All that's necessary is moving that one line up within the if() statement.
foreach ($updates as $number => $queries) {
if ($number != '#abort') {
$output .= '<h4>Update #'. $number .'</h4>';
$output .= '<ul>';
foreach ($queries as $query) {
if ($query['success']) {
$output .= '<li class="success">'. $query['query'] .'</li>';
}
else {
$output .= '<li class="failure"><strong>Failed:</strong> '. $query['query'] .'</li>';
}
}
if (!count($queries)) {
$output .= '<li class="none">No queries</li>';
}
}
$output .= '</ul>';
}
Comment | File | Size | Author |
---|---|---|---|
update-6.x-misplaced_close_ul.patch | 388 bytes | AlexisWilke | |
update-7.x-spurious_close_ul.patch | 459 bytes | AlexisWilke | |
Comments
Comment #1
AlexisWilke CreditAttribution: AlexisWilke commentedFix status actually. 8-)
Comment #2
droplet CreditAttribution: droplet commentedgreat, how do you catch this error :)
Comment #3
AlexisWilke CreditAttribution: AlexisWilke commenteddroplet,
In this case, I found it reading the code. But you can find such problems using wget or similar tools. The problem is that browsers will fix those problems by default, but it can at times cause problems (they are not made smart enough to know the real intend and at times it just doesn't match 1 to 1.)
Thank you.
Alexis
Comment #4
rfayComment #5
AlexisWilke CreditAttribution: AlexisWilke commentedrfay,
Are you sure it's "database update system" and not just "update system" as I set it up before?
It is specific to the update.php script.
Thank you.
Alexis
Comment #6
droplet CreditAttribution: droplet commentedoh. I changed to a wrong Component at#2
Comment #7
rfay@AlexisWilke - They seem to have changed the name of the component from 'update system' to 'database update system'. I don't know why
Comment #8
aspilicious CreditAttribution: aspilicious commentedThey changed it because the name was confusing
update system vs update.module
Comment #9
webchickCommitted to HEAD. Thanks!
(Also, I just love the word "spurious" ;))
Marking down to 6.x.
Comment #10
Gábor HojtsySuperb, committed, pushed. (And looked up the definition for spurious :D)