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>';
      }
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

AlexisWilke’s picture

Status: Active » Needs review

Fix status actually. 8-)

droplet’s picture

Component: update system » ajax system
Status: Needs review » Reviewed & tested by the community

great, how do you catch this error :)

AlexisWilke’s picture

droplet,

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

rfay’s picture

Component: ajax system » database update system
AlexisWilke’s picture

rfay,

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

droplet’s picture

Issue tags: +Quick fix

oh. I changed to a wrong Component at#2

rfay’s picture

@AlexisWilke - They seem to have changed the name of the component from 'update system' to 'database update system'. I don't know why

aspilicious’s picture

They changed it because the name was confusing

update system vs update.module

webchick’s picture

Version: 7.x-dev » 6.x-dev

Committed to HEAD. Thanks!

(Also, I just love the word "spurious" ;))

Marking down to 6.x.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Superb, committed, pushed. (And looked up the definition for spurious :D)

Status: Fixed » Closed (fixed)
Issue tags: -Quick fix

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