luci-app-nut input validation error
Open
Nobody has claimed this yet.
- Dominant language
- Makefile
- Stars
- 4.6k
- Forks
- 4k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 134
Description
I'm luci-app-nut.
When altering the the field [Off Delay(s)] under the driver config it requires an integer. When inputting for example 120 it gives the error:
/usr/lib/lua/luci/model/cbi/nut_server.lua:186: attempt to compare nil with string
stack traceback:
/usr/lib/lua/luci/model/cbi/nut_server.lua:186: in function 'validate'
/usr/lib/lua/luci/cbi.lua:1426: in function 'parse'
/usr/lib/lua/luci/cbi.lua:1562: in function 'parse'
/usr/lib/lua/luci/cbi.lua:248: in function 'parse'
/usr/lib/lua/luci/cbi.lua:1184: in function 'parse'
/usr/lib/lua/luci/cbi.lua:248: in function 'parse'
/usr/lib/lua/luci/cbi.lua:387: in function 'parse'
/usr/lib/lua/luci/dispatcher.lua:1410: in function '_cbi'
/usr/lib/lua/luci/dispatcher.lua:1056: in function 'dispatch'
/usr/lib/lua/luci/dispatcher.lua:483: in function </usr/lib/lua/luci/dispatcher.lua:482>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at /usr/lib/lua/luci/model/cbi/nut_server.lua around line 186 and reproduce the error by changing the driver config's Off Delay(s) field to 120. Inspect the validate function and confirm the field accepts an integer without raising the reported comparison error; verify the form can be submitted successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100