Bruno17 / MIGX

MIGX for revo 2.2 and above
83 stars 78 forks source link

Flatten JSON array so objects are processed properly #368

Closed hugopeek closed 3 years ago

hugopeek commented 3 years ago

After updating MIGX, it broke the output in a few places for me. Turns out I was using a modified migxJsonToPlaceholders snippet (and forgot about it).

Apparently, the JSON output of migxLoopCollection can't be processed properly if it's a JSON object. So this fails:

[
  {
    "id":"14",
    "createdon":"1603985676",
    "createdby":"1",
    "deleted":"0"
  }
]

But this works:

{
  "id":"14",
  "createdon":"1603985676",
  "createdby":"1",
  "deleted":"0"
}

After flattening the array first, both options work. See SO for more info.