Closed Simply007 closed 6 years ago
HINT: you can use http://requirebin.com/ for reproducing the issue - just paste the code open the console and run the code by the button.
Well spotted! Let's raise the depth parameter then.
Fixed, thanks for the detailed info!
The error message will now contain further information to help users debug the issue in this format:
Modular content item with codename '${codename}' is not present in Delivery response. This modular item was requested by '${field.name}' field. Error can usually be solved by increasing 'Depth' parameter of your query.
Do we wan to add DepthParameter to the pre-ultimate code snippet on https://developer.kenticocloud.com/docs/get-titles-and-images-of-5-latest-articles to prevent raising error in case reader would try it? Or are we OK thet this code snippet is just a sample and just the ultimate one should be working on our sample project that is specifying fields, that does not require depth parameter to load the content?
Corrected in the docu.
When I use the code from javascript penultimate code snippets from documentation: https://developer.kenticocloud.com/docs/get-titles-and-images-of-5-latest-articles
I got en error (thce the same):
It is because loaded article is using modular content in the field body_copy and the data for modular content are not in the returned data (default value of the depth parameter is 1). Error is not clear about what really happens - I was force to debug the sdk to find the real cause. I am pretty OK with the error (maybe warning), but the message must me more specific.
Are we OK, that the code snippet in documentations leads to error, or we should add i.e.
.depthParameter(2)
to the query specification to prevent the error?