Arc Forumnew | comments | leaders | submitlogin
3 points by lark 4338 days ago | link | parent

Here's a testcase:

  (mac usform (n s f . body)
   (w/uniq ga
     `(tag (form method 'post action fnurl* class (string ,s) id ,n name ,n
                enctype "multipart/form-data")
       (fnid-field (fnid (fn (,ga)
                           (prn)
                           (,f ,ga))))
       ,@body)))

  (defop || req
    (usform "this-is-a-bug" "" [ (pr "args are " _) ]
          (tab (row "price: " (input "price"))
               (submit))))

  (def main ()
     (asv))


1 point by akkartik 4338 days ago | link

Ah, this is because the fnid field is being read as a list of bytes. I could convert fnid to string as a special case. Another option is to pass it in with the action url like in aform-multi: http://github.com/nex3/arc/blob/46e3820a6b/lib/srv.arc#L560

Update: Ok, I finally found a way to check when it's safe to convert to string, so now all fields (including fnid) will auto-convert to string when possible. If you get a list of bytes you know it has some sort of non-ascii data.

http://github.com/nex3/arc/commit/d5331ac897

But it's probably made things a tad slower still (let me know). Sucks that reading characters in scheme just hangs when it should throw an error.

-----

1 point by akkartik 4332 days ago | link

Eek, there was still a bug in that. Here's the corrected commit: http://github.com/nex3/arc/commit/1882b3b589

I've also made it faster; 4x faster in my experiments. http://github.com/nex3/arc/commit/16173ec1ff

Do a git pull and give it a whirl.

-----