MT#7959 fix contract PUT/PATCH, tests

now that type is checked by form, it must be
properly passed by put/patch. Also error message changed.

(cherry picked from commit 526a6c1a194e66f367fb8d94e9c3327a26c49619)