philsturgeon / ee2-rest

Integrate RESTful API's into your ExpressionEngine 2.0 website with this Rest module.
http://devot-ee.com/add-ons/rest
34 stars 13 forks source link

Nested objects with the same name aren't accessible #1

Open sperte opened 12 years ago

sperte commented 12 years ago

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.

philsturgeon commented 12 years ago

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. :-/

sperte commented 12 years ago

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

philsturgeon commented 12 years ago

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.

derekjones commented 12 years ago

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.