Select to view content in your preferred language

Circular reference in a query items request

4178
10
10-28-2015 12:57 AM
Iratxe_Orbe
Deactivated User

I am working on a custom widget. One of the things I need to do is to query a group item from AGOL. To do this I use the query items methods as below with the required parameters.

When I work authenticated with an enterprise login, it all worked as it was expected. But when I authenticated with an AGOL user I receive an error: Uncaught RangeError: Maximum call stack size exceeded. It was that when the request that is shown above was done, ArcGIS javascript API was generating an object with a circular reference and the widget crashes. The request is a search (sharing/rest/search) request and the parameters are

the following: f=json&q=group%3A"6264b2c574414393886a3bcb43dd8fba"&sortField=modified&sortOrder=DESC&num=100&token=<token>

If we look at the network tab of the developers tools, the response to this request is correct. So, that this response suffers some changes before arriving to the callback function. Once inside the callback function the data parameter has been modified. Inside each result has a portal object, that contains a user object inside, that references the previous portal oblect again and so on.

This only happens when you are logged in with an AGOL user. It might also be worth mentioning that in our case all AGOL items are inside an enterprise site.

Has this happen to any of you? Have you any solution besides deleting the circular reference objects?

Thanks in advance

0 Kudos
10 Replies
Iratxe_Orbe
Deactivated User

Thanks, anyway Robert!

I don't know what can be happening, but with enterprise users works as expected, but it doesn't with AGOL ones. Probably is not something regarding to the request, maybe is related with the function queryItems that is not creating the object fine.

0 Kudos