Forum OpenACS Development: Invalid input syntax for integer
What would be the best solution to the error bellow?
I may create datatype validation as follows:
2. To add -validate block in the ad_page_contract statement
3. To add -validate block in the ad_form template
4. What else is abvailable?
[12/Dec/2017:10:49:45][1890.7f23de866700][-conn:evex:0-] Notice: Add Item
[12/Dec/2017:10:49:45][1890.7f23de866700][-conn:evex:0-] Error: nsdbpg: result status: 7 message: ERROR: invalid input syntax for integer: "dfwfveqrwcv"
LINE 18: 'dfwfveqrwcv'
Hope this helps
That way, validation comes within the acs-template pkg.
This option would even reduce the amount of code within ad_form -on_submit, or ad_page_contract blocks.
For the ad_page_contract, you do not necessarily have to have a validate block, but you should use in the "argspec" the type "integer "(or "naturalnum", etc.) . The validate block is just needed for detailed checks (check for certain integers, checks against the db, etc.)