You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In CKAN 2.8.4, reading a Jinja variable which was not defined results in reading an empty string. Looping over an undefined variable will therefore quietly ignore the loop. This happens even in debug mode.
To facilitate development, such reads should be reported somehow. Jinja's StrictUndefined allows to cause a crash when reading an undefined variable, but that may be excessive even in debug mode. What I would recommend would be to define some handler which would add something to the "Debug x" section at the bottom of pages, probably in a new "Jinja warnings" subsection if there is none. Or perhaps to add a part in the paragraph of each template which generates warnings.
In CKAN 2.8.4, reading a Jinja variable which was not defined results in reading an empty string. Looping over an undefined variable will therefore quietly ignore the loop. This happens even in debug mode.
To facilitate development, such reads should be reported somehow. Jinja's StrictUndefined allows to cause a crash when reading an undefined variable, but that may be excessive even in debug mode. What I would recommend would be to define some handler which would add something to the "Debug x" section at the bottom of pages, probably in a new "Jinja warnings" subsection if there is none. Or perhaps to add a part in the paragraph of each template which generates warnings.
Jinja's make_logging_undefined() seems to allow creating such handlers. I had trouble understand its description, but the example in this message suggests it's not difficult.
The text was updated successfully, but these errors were encountered: