cubicweb #784299 Form error display in non-ajax mode [resolved]

When using non-ajax mode to validate a form, if a Validation error occurs, it's not displayed correctly. The reason is : the form field_error method doesn't find the error in the self.form_valerror.errors dict, because the keys in it are based on field.name whereas it searches for field.role_name() (the latter being the supposed correct behaviour).

Below is a (custom printed) traceback showing where the ValidationError comes from in our case (=> yams)

File "/home/vincent/veolia/cubicweb/web/views/editcontroller.py", line 256, in _action_apply
  self._default_publish()
File "/home/vincent/veolia/cubicweb/web/views/editcontroller.py", line 86, in _default_publish
  eid = self.edit_entity(formparams)
File "/home/vincent/veolia/cubicweb/web/views/editcontroller.py", line 173, in edit_entity
  self._update_entity(eid, rqlquery)
File "/home/vincent/veolia/cubicweb/web/views/editcontroller.py", line 131, in _update_entity
  self._cw.execute(rqlquery.update_query(eid), rqlquery.kwargs)
File "/home/vincent/veolia/cubicweb/dbapi.py", line 291, in execute
  return self.cursor.execute(*args, **kwargs)
File "/home/vincent/veolia/cubicweb/dbapi.py", line 650, in execute
  parameters, eid_key, build_descr)
File "/home/vincent/veolia/cubicweb/server/repository.py", line 588, in execute
  build_descr)
File "/home/vincent/veolia/cubicweb/server/querier.py", line 659, in execute
  results = plan.execute()
File "/home/vincent/veolia/cubicweb/server/querier.py", line 172, in execute
  result = step.execute()
File "/home/vincent/veolia/cubicweb/server/ssplanner.py", line 446, in execute
  repo.glob_update_entity(session, edef, attributes)
File "/home/vincent/veolia/cubicweb/server/repository.py", line 1043, in glob_update_entity
  entity.check()
File "/home/vincent/veolia/cubicweb/entity.py", line 871, in check
  self.e_schema.check(self, creation=creation, _=_)
File "/home/vincent/veolia/yams/schema.py", line 521, in check
  raise ValidationError(entity, errors)
priorityimportant
typebug
done in3.7.2
load0.200
load left0.000
closed by<not specified>