Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix category extra AJAX call for categories with ampersands
The `IF category_extras.$category.size` condition in category_extras.html was using an escaped string for `$category`, meaning the lookup would always fail for categories that had an ampersand in their name. The result of this was an empty `<div id="category_meta">`, and no extra fields shown to the user. This caused issues when one or more of the fields were required, as they were always empty and the error message wasn't being rendered and shown to the user. This meant the user would see their report form over and over again when submitting instead of useful feedback. We also ensure $category is always a SafeString when used as a key into a hashref in other templates. Fixes mysociety/fixmystreet-freshdesk#126
- Loading branch information
Showing
7 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<p> | ||
[% category = mark_safe(category) %] | ||
[% UNLESS non_public_categories.$category; | ||
|
||
tprintf( | ||
|