eXist-db / shared-resources

An app package with shared resources used by several eXist-db applications
5 stars 16 forks source link

Feature Request: Add request attribute as an alternative for parameter injection with the templating module #4

Closed peterstadler closed 11 years ago

peterstadler commented 11 years ago

Currently, only request parameters and session attributes are injected as function parameters while request attributes (as beeing set by controller actions with set-attribute) are not taken into account. Commit 9b1315695a01da4888eb8401b41dd685158fe1a2 contains the actual proposal while 688757da6d8d2bab68a7c92b9d24824635ad6278 and 534cc2c4d922d6981278dcea92662fd0fbe3fa6a are small bug fixes. I do wonder though, why the declaration of $templates:TYPE_ERROR was missing (for several months) since the code breaks without it?!

joewiz commented 11 years ago

I noticed the $templates:TYPE_ERROR issue in the public-repo app and fixed it for that app in http://sourceforge.net/p/exist/code/18731. It may persist in other apps too. The fact that the code didn't break before this makes me wonder whether global variable declarations like $templates:TYPE_ERROR are not being checked during static analysis.

wolfgangmm commented 11 years ago

Due to a bug in the try-catch implementation, static analysis did not descend into the catch clause in which $templates:TYPE_ERROR was used. The error popped up after I fixed this issue.

joewiz commented 11 years ago

Cool, thanks for the info, Wolfgang. I recall seeing the try-catch commit in eXist-db/exist@affb9bb56d3db3d0920f09ddcdc28c378c5e7f98 but didn't realize that was the "cause" of this code now "breaking".

peterstadler commented 11 years ago

Thanks for the quick response! Love the new GitHub means :-)