Menu

Trac Commit Log


Commit Date  
[r6136] by cboos

Make the error.html template more useful when Javascript is not enabled.

The default view is the plain text view, and only when Javascript is available does the interactive view and the toggle button get shown.

2007-11-08 10:40:40 Tree
[r6135] by cboos

Follow-up to r6126: finally understood what that `del req.chrome` was good for...

This was needed when an error occurs during the rendering of a template.

Here's a summary of what happens:
1. render_template() is called normally, the data is prepared and the chrome data is filled with the initial values obtained from the req callback for chrome, augmented by all calls to add_link, add_scripts etc.
2. right before the template stream is rendered, the req.chrome fields are reset to empty lists, which are also reachable by the `late_links` and `late_scripts` values
3. oops, an internal error while rendering
4. the `req.chrome['links']` are restored so that they can be used while rendering the error template
5. the error handling code does another round of render_template(), this time for the error.html template
6. now the interesting stuff happens if it's an internal error:
- the chrome data gets updated again with the req.chrome, which are at this point still the (empty) "late" lists, and because of that, the jquery.js script is not loaded and the nice interactive stack trace display ''doesn't work'' anymore
- before, when we had the `del req.chrome`, when the chrome data got updated by the req.chrome, this triggered ''another'' call to the req callback for "chrome", i.e. another Chrome.prepare_request, which would add among other things the jquery.js back...

So I think an "obvious" fix of this problem while still preserving the #5594 behavior is to restore the 'scripts' as well at point 4.

Of course, the management of the chrome data could probably be greatly simplified at some point after 0.11.

2007-11-07 16:44:34 Tree
[r6134] by cboos

context-refactoring: merging changes from [6115:6128/trunk]

2007-11-06 16:38:55 Tree
[r6133] by cboos

context-refactoring: fix "typo" (TICKET_VIEW instead of WIKI_VIEW)

2007-11-06 14:16:16 Tree
[r6132] by cboos

context-refactoring: make sure that a rendering context `.perm` is actually bound to that context `.resource`.

2007-11-06 14:10:50 Tree
[r6131] by cboos

context-refactoring: fixed bugs with saved custom queries

2007-11-06 13:06:08 Tree
[r6130] by cboos

context-refactoring: add trac.mimeview.api doctests to the suite.

2007-11-06 13:00:00 Tree
[r6129] by cboos

context-refactoring: eliminate `Resource.from_spec` in favor of a more flexible `Resource` constructor.

Also, in the various places where resource specifications are optionally given, make sure that the `False` value is used for the default argument, as `None` can be a valid argument:
- for `resource`, `None` means consider the realm as a whole
- for `version`, `None` means use the latest revision

2007-11-06 12:58:08 Tree
[r6128] by cboos

Fix and simplify the svn:externals property render.

2007-11-06 11:33:06 Tree
[r6127] by cboos

Clean-up the `request_dispatcher` and shutdown the environment after error processing.

2007-11-06 10:58:11 Tree
Older >