Modify ↓
Opened 9 years ago
Closed 9 years ago
#12517 closed defect (fixed)
invalid verification in `_arg_as_int()`
| Reported by: | Owned by: | Ryan J Ollos | |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.0.12 |
| Component: | wiki system | Version: | 1.0-stable |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: |
Fixed |
||
| API Changes: | |||
| Internal Changes: | |||
Description
the value returned by as_int() should be checked against None, otherwise we it is not possible to use 0 as value for some parameters as depth
example:
[[TitleIndex(Wiki, depth=0)]]
results in:
proposed fix:
-
trac/wiki/macros.py
diff --git a/trac/wiki/macros.py b/trac/wiki/macros.py index 345cb53..450393d 100644
a b class TracGuideTocMacro(WikiMacroBase): 915 915 916 916 def _arg_as_int(val, key=None, min=None, max=None): 917 917 int_val = as_int(val, None, min=min, max=max) 918 if not int_val:918 if int_val is None: 919 919 raise MacroError(tag_("Invalid macro argument %(expr)s", 920 920 expr=tag.code("%s=%s" % (key, val)) 921 921 if key else tag.code(val)))
Attachments (0)
Change History (2)
comment:1 by , 9 years ago
| Milestone: | → 1.0.12 |
|---|---|
| Owner: | set to |
| Release Notes: | modified (diff) |
| Status: | new → assigned |
| Version: | 1.2dev → 1.0-stable |
comment:2 by , 9 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.



Thanks for reporting. This is a regression in [14769] (#12370).