react icon indicating copy to clipboard operation
react copied to clipboard

[BUG] React-formio: getForm Action is not working when try to fetch form details by alias.

Open hanumanthraju opened this issue 6 years ago • 0 comments

Environment

Please provide as many details as you can:

  • react-formio: ^4.0.0-rc.11
  • Formio.js version: ^4.0.0-rc.21

Steps to Reproduce

Try to fetch form details by form alias or name.

Expected behavior

Fetch a form from the server. If no id is provided, the name is used as the path

Observed behavior

TypeError: Cannot read property '1' of null

Example

Screenshot 2019-12-24 at 7 48 26 PM Screenshot 2019-12-24 at 8 00 55 PM Screenshot 2019-12-24 at 8 01 05 PM React Reducer sample code
 event: combineReducers({
    form: form({ name: 'event'}),
    submission: submission({name: 'event'}),
    submissions: submissions({name: 'event'}),
  })

const mapDispatchToProps = (dispatch, ownProps) => {
  return {
    getForm: () => dispatch(getForm('event')),
    onSubmit: (submission) => {
      dispatch(saveSubmission('event', submission, null, (err, submission) => {
        if (!err) {
          dispatch(resetSubmissions('event'));
          dispatch(push(`/event`))
        }
      }));
    }
  }
}

I think issue is because of missing a forward slash in Ternary Operation on line 81 in Action.js file of form module. Screenshot 2019-12-24 at 8 10 23 PM

hanumanthraju avatar Dec 24 '19 14:12 hanumanthraju