Thanks to all the folks that added the icons to message/warning/error boxes: #874370: System messages need identifying icons (WCAG 2.0)

I have found a small bug that turned up once the icons were added. When an AJAX error occurs on a /batch page (and probably elsewhere).

Recreate:
* Create a new simpletest (anywhere)
* Inside the test function, call a function that doesn't exist
* An ajax error will return that contains the error that occurred inside the simpletest (the fact that it does it this way is probably an issue of it's own)
* Your progress bar should be replaced with the error message itself

My error message looks like this:

ajax-icon-error.png

The problem occurs because these errors don't contain the messages class. This has been the case for a while (I think), but wasn't really a concern until the icons were added and were allowed to... be a little overeager. :)

I'll see if I can work up a patch for this, but I'm not extremely familiar with the AJAX code, so I'm not sure how it'll go.

CommentFileSizeAuthor
#4 ajax-icon-error-corrected.png43.28 KBAnonymous (not verified)
#5 906922-ajax-batch-error-icon-1.patch657 bytesAnonymous (not verified)
#3 906922-ajax-batch-error-icon.patch603 bytesAnonymous (not verified)
ajax-icon-error.png62.43 KBAnonymous (not verified)

Comments

Anonymous’s picture

Also, the error message reads:

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: /batch?id=6&op=do StatusText: OK ResponseText: Fatal error: Call to undefined method CommerceSandboxTestCase::debug() in /Users/auzigog/Development/drupalcommerce/tests/commerce_base.test on line 422

mgifford’s picture

Alerting this of this error. Where is this used other than simpletest?

Anonymous’s picture

Status: Active » Needs review
StatusFileSize
new603 bytes

Patch was really simple. Just needed to modify one line inside batch.js.

See attached.

Anonymous’s picture

Status: Fixed » Needs review
StatusFileSize
new43.28 KB

@mgifford - Batch is used on Drupal install, simpletests, and when you manually check for updates on admin/reports/updates. Possibly other places as well.

Also, here's what the corrected output should look like:

ajax-icon-error-corrected.png

Also, my patch seems to add to the "p" class instead of the "div" class (as it should). I'll see if I can track down the appropriate place to add the messages class to the div.

Anonymous’s picture

StatusFileSize
new657 bytes

Here is a grep of all instances of class="error":

$ grep -r 'class=\"error\"' .
./includes/install.inc:        $message .= '<p class="error">' . $result  . '</p>';
./misc/progress.js:  var error = $('<div class="error"></div>').html(string);
./modules/system/system.admin.inc:    $disabled_message = ' ' . t('<strong class="error">Set up the <a href="!file-system">public files directory</a> to make these optimizations available.</strong>', array('!file-system' => url('admin/config/media/file-system')));
./sites/all/modules/views/plugins/views_plugin_display.inc:          $template = '<strong class="error">' . $template . ' ' . t('(File not found, in folder @template-path)', array('@template-path' => $template_path)) . '</strong>';
./update.php:    $output = '<p class="error">The update process was aborted prematurely while running <strong>update #' . $version . ' in ' . $module . '.module</strong>.' . $log_message;

Turns out the patch needs to change misc/progress.js

New patch attached.

bleen’s picture

Status: Needs review » Reviewed & tested by the community

personally I think the screenshot in the original post looks pretty good, but if you want to be a stickler about it ... RTBC

mgifford’s picture

@bleen18 - That was pretty funny.

@auzigog - The patch applies nicely, thanks for nailing this!

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD.

sun’s picture

Welcome to the Drupal core development team, auzigog! :) Nice patch.

Anonymous’s picture

@sun - Thanks. It's fun here. :)

Status: Needs review » Closed (fixed)

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