Given the fact that Drupal.ajaxError() uses line breaks to format its output and even removes HTML tags at one point, shouldn't it return its output wrapped >pre< ?

Comments

alex_b’s picture

devin carlson’s picture

Version: 7.x-dev » 8.x-dev
StatusFileSize
new527 bytes

I can confirm that Drupal.ajaxError() does use line breaks to format output and strips HTML output. The patch makes the error output readable.

Attached is the same patch but against D8.

Status: Needs review » Needs work

The last submitted patch, wrap-error-output-in-pre-tags-898582.patch, failed testing.

jthorson’s picture

Status: Needs work » Needs review

Testbot was misbehaving ... it's been punished accordingly. Resetting test.

jthorson’s picture

Status: Needs review » Needs work

The last submitted patch, wrap-error-output-in-pre-tags-898582.patch, failed testing.

devin carlson’s picture

Status: Needs work » Needs review

I'm going to assume that the testbot was misbehaving again...

jthorson’s picture

Status: Needs review » Needs work

The last submitted patch, wrap-error-output-in-pre-tags-898582.patch, failed testing.

jthorson’s picture

Status: Needs work » Needs review

Okay ... testbot beaten into submission. Tests passed.

devin carlson’s picture

StatusFileSize
new500.54 KB
new499.19 KB

Attached are two screenshots: one showing AJAX error output without the <pre> tags and one with the <pre> tags added.

nod_’s picture

Status: Needs review » Needs work

Error needs to be replanned, see #1606362: Use throw when an ajax error occurs and extend JavaScript's Error object.

That said it's a welcome improvement. Needs reroll though.

(edit) oh and don't put the <pre> at this level, what we need it at the progress.js level, that's the only place we're adding the error output to the HTML.

nod_’s picture

Issue summary: View changes
Issue tags: +Novice, +JavaScript
applicity_sam’s picture

Checking to see how to replicate the issue as this seems to be resolved in issue #2000558

applicity_sam’s picture

In order to test this we did the following:

- Created a new module with an update hook that dies.
- Run update.php to apply the database updates.
- Checked that the returned error message is wrapped in pre tags.

Confirmed as no longer an issue. Closing issues

nod_’s picture

Status: Needs work » Fixed

Thanks for checking!

Status: Fixed » Closed (fixed)

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