ee2-rest icon indicating copy to clipboard operation
ee2-rest copied to clipboard

Nested objects with the same name aren't accessible

Open sperte opened this issue 12 years ago • 4 comments

For instance, when accessing the Facebook Graph API, there's an object ID ({id}) but also an author ID ({from}{id}{/from}). The latter still returns the parent's object value.

sperte avatar Aug 13 '12 22:08 sperte

This is down to a bug in the ExpressionEngine Template library that I have reported multiple times. I first alerted a developer at EllisLab about this 2 years ago, and since then after multiple requests they still have not fixed it. :-/

philsturgeon avatar Aug 29 '12 17:08 philsturgeon

Thanks for your reply, Phil. Not sure why I missed it until now.

sperte avatar Oct 20 '12 00:10 sperte

No worries. I'm going to keep this open until EllisLab fix the bug, which may well be never. Their parser is pretty weak for things like this.

philsturgeon avatar Oct 24 '12 22:10 philsturgeon

Without a trigger to tell the parser your intention, it cannot know which tag the front end developer is wishing to "own" identically named variables. There are countless common cases where the inner tag pair / module is acting on the rendered value of a parent tag pair / module. If the parser assumed scope at only the most deeply nested level, a lot of ExpressionEngine functionality would be lost.

Incidentally, our engineers are looking at this internally to find a good solution that supports both.

derekjones avatar Oct 25 '12 16:10 derekjones