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

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.0
    • None
    • None
    • Kromeriz 99
    • 1

      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.

        Acceptance criteria

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

                Created:
                Updated:
                Resolved: