projectcaluma / ember-caluma

Ember.js addons for Caluma
https://docs.caluma.io/ember-caluma/
GNU Lesser General Public License v3.0
18 stars 22 forks source link

calcExpression over table questions fails #1235

Closed sbor23 closed 3 years ago

sbor23 commented 3 years ago

Steps

  1. create a form "root-form"
  2. create another form "row-form"
    1. in "row-form", create an integer question "2-integer-question"
  3. in "root-form", create
    1. table question "2-table-question", with "row-form"
    2. calculated float question with calcExpression '2-table-question'|answer|mapby('2-integer-question')|sum

Trying to fill a document for "root-form" fails with the following stacktrace:

dependencies.js:99 Uncaught (in promise) TypeError: Cannot read property 'map' of null
    at dependencies.js:99
    at Array.flatMap (<anonymous>)
    at Class.<anonymous> (dependencies.js:88)
    at index.js:2135
    at untrack (validator.js:780)
    at ComputedProperty.get (index.js:2134)
    at Class.CPGETTER_FUNCTION [as calculatedDependencies] (index.js:1124)
    at Class.<anonymous> (field.js:239)
    at index.js:2135
    at untrack (validator.js:780)

Code is here: https://github.com/projectcaluma/ember-caluma/blob/master/addon/lib/dependencies.js#L119

anehx commented 3 years ago

:tada: This issue has been resolved in version 6.10.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: