Display something more error-like when an AJAX block errors out
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Medium
|
Aaron Wells | ||
15.04 |
Won't Fix
|
Medium
|
Aaron Wells | ||
15.10 |
Fix Released
|
Medium
|
Aaron Wells | ||
16.04 |
Fix Released
|
Medium
|
Aaron Wells | ||
16.10 |
Fix Released
|
Medium
|
Aaron Wells |
Bug Description
Spinning this bug off from Bug 1544424 (Endless JS loop if there's an uncaught exception in an ajax block) since patch https:/
We no longer get an endless loop when an Ajax block errors out, but it still looks pretty bad. See the attached screenshot. Because the file "blocktype.
This looks confusing to the user, and it can spill over out of that block's space and cover up adjacent blocks. It would be better if we printed something that more obviously indicates that just this one block is broken, and that doesn't break the display of other blocks.
Changed in mahara: | |
milestone: | 16.10.0 → none |
status: | Fix Committed → Fix Released |
Testing this requires causing an error or exception in one of the ajax block's render_instance methods. The easiest way to do this is to just add an exception into one of the core blocks:
1. Open up file htdocs/ blocktype/ newviews/ lib.php
2. Locate the function "render_instance()" on line 32.
3. Inside that function, put an exception, like so:
public static function render_ instance( BlockInstance $instance, $editing=false) {
global $USER;
// here's an exception
throw new Exception('die.');
$configdata = $instance-
$nviews = isset($
4. Log in to Mahara and view your dashboard (which should contain a new views block as per the default)
Expected result: The new view block indicates that it has failed to load properly.
Actual result: The new view block displays an unreadable, compressed version of the Mahara page header. (See screenshot).