Uploaded image for project: 'Magnolia Javascript Models'
  1. Magnolia Javascript Models
  2. JSMODELS-6

Bad type when passing a returned js object to another js function

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 1.0
    • None
    • None

    Description

      If you pass returned javascript object (array, json) to the model, it's type gets changed and it does not behave as it should if you pass it again to another model function.

      To reproduce:

      1. Return an JS array from a model function.
      2. Pass the returned array to another model function.

      (Problem is not just with arrays though.)

      Result:

      • It cannot be iterated with for(var item in input) {
      • It cannot be iterated with for each (item in input){
      • it does not have a length.

      From Jaroslav:
      It's something related to freemarker template object wrapping, so fixing it might be a little bit tricky.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                jsimak Jaroslav Simak
                czimmermann Christopher Zimmermann
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD