formio.js icon indicating copy to clipboard operation
formio.js copied to clipboard

[BUG] form.showError no longer accepts strings

Open paulfalgout opened this issue 4 years ago • 4 comments

  • Formio.js version: 4.13.0

Steps to Reproduce

  1. form.showErrors('error');
  2. form.showErrors(['error']);

Expected behavior

Previous to https://github.com/formio/formio.js/commit/9d645494d4cb89b8fc5df78ae5a5bed0006504f0#diff-7855a6dd80d9df39fdfc8b5408184edab6a38ecfb49a165c448d5dfab1264a1fR1210 showError accepted a string or an array of strings

Observed behavior

showError fails with "TypeError: Cannot create property 'formattedKeyOrPath' on string"

paulfalgout avatar Apr 14 '21 08:04 paulfalgout

Hello @paulfalgout, Can you provide an example of the issue taking place as well as a video?

wag110894 avatar Jun 23 '21 16:06 wag110894

No need for a video. https://jsfiddle.net/5cgkuj8n/

Formio.createForm(...).then(function(form) {
  // Both of these used to work and now they don't
  form.showErrors('error');
  form.showErrors(['error']);
});

paulfalgout avatar Jun 23 '21 16:06 paulfalgout

@paulfalgout

Was your issue addressed? The docs say it has to be an object but webform.js itself still uses string. This is getting quite confusing #4862

bilogic avatar Sep 16 '22 10:09 bilogic

AFAIK this hasn't been addressed @bilogic

paulfalgout avatar Sep 19 '22 13:09 paulfalgout

Closing this thread as it is outdated. Please re-open if it is still relevant. Thank you for your contribution!

Tatsiana8 avatar Feb 07 '24 14:02 Tatsiana8