OpenSource-Tools / LiquidVoting

1 stars 0 forks source link

Error on add initiative #58

Closed kvdmolen closed 9 years ago

kvdmolen commented 9 years ago

Adding new initiative to existing issue, cannot be saved, gives error when click "preview":

http://178.62.254.91/lf/initiative/new.html?issue_id=17

../env/encode/html.lua:17: bad argument #1 to 'gsub' (string expected, got nil)
Stack trace follows:
[C]: in function 'gsub'
../env/encode/html.lua:17: in function 'html'
/opt/LiquidVoting/frontend/app/main/initiative/new.lua:75: in function 'content'
../env/ui/tag.lua:38: in function <../env/ui/tag.lua:15>
(...tail calls...)
/opt/LiquidVoting/frontend/env/ui/sectionHead.lua:13: in function 'sectionHead'
/opt/LiquidVoting/frontend/app/main/initiative/new.lua:73: in function 'content'
../env/ui/tag.lua:38: in function <../env/ui/tag.lua:15>
(...tail calls...)
/opt/LiquidVoting/frontend/env/ui/section.lua:13: in function 'section'
/opt/LiquidVoting/frontend/app/main/initiative/new.lua:72: in function 'content'
...
/opt/LiquidVoting/frontend/app/main/_filter/20_session.lua:26: in function 'func'
../env/execute/file_path.lua:24: in function 'file_path'
../env/execute/_add_filters_by_path.lua:17: in function 'wrapper_func'
../env/execute/wrapped.lua:21: in function <../env/execute/wrapped.lua:11>
(...tail calls...)
../env/execute/filtered_view.lua:28: in function 'filtered_view'
webmcp.lua:382: in function <webmcp.lua:257>
[C]: in function 'xpcall'
webmcp.lua:256: in main chunk
[C]: in function 'pcall'
/opt/webmcp/cgi-bin/webmcp-wrapper.lua:7: in main chunk
[C]: in ?
nktc commented 9 years ago

I am able to reproduce this. http://178.62.254.91/lf/initiative/new.html?issue_id=4

This is related to #27. The preview is trying to html encode issue name, but there is no issue name in the form if the initiative is being added to an existing issue, rather than creating one inline.

This bug is fixed now.

kvdmolen commented 9 years ago

This bug got back :( different error now I think..

...idVoting/frontend/app/main/initiative/_action/create.lua:74: attempt to get length of local 'issue_name' (a nil value)
Stack trace follows:
...idVoting/frontend/app/main/initiative/_action/create.lua:74: in function 'func'
../env/execute/file_path.lua:24: in function 'file_path'
../env/execute/action.lua:19: in function 'action'
../env/execute/filtered_action.lua:35: in function <../env/execute/filtered_action.lua:34>
(...tail calls...)
../env/execute/multi_wrapped.lua:18: in function 'inner_func'
../env/execute/inner.lua:19: in function 'inner'
/opt/LiquidVoting/frontend/app/main/_filter/21_auth.lua:129: in function 'func'
../env/execute/file_path.lua:24: in function 'file_path'
../env/execute/_add_filters_by_path.lua:17: in function 'wrapper_func'
...
...ting/frontend/app/main/_filter_action/10_transaction.lua:3: in function 'func'
../env/execute/file_path.lua:24: in function 'file_path'
../env/execute/_add_filters_by_path.lua:17: in function 'wrapper_func'
../env/execute/wrapped.lua:21: in function <../env/execute/wrapped.lua:11>
(...tail calls...)
../env/execute/filtered_action.lua:32: in function 'filtered_action'
webmcp.lua:313: in function <webmcp.lua:257>
[C]: in function 'xpcall'
webmcp.lua:256: in main chunk
[C]: in function 'pcall'
/opt/webmcp/cgi-bin/webmcp-wrapper.lua:7: in main chunk
[C]: in ?
nktc commented 9 years ago

This should be fixed. Error was related to handling form processing for new issue vs. new issue + new initiative. Both should work now.