Closed wmbeers closed 3 years ago
Fixed in 3a768dd1695fb59618dc26be48cc3bf34abad7c0.
This is done, will be deployed later as it's a trivial issue now that the services have been refreshed. (Also can't fully test it because the conditions that made it apparent has been resolved server side.)
This block of code in the addLayerInfo method of the Identify widget has a flaw:
// If is a feature layer that does not support // Identify (Feature Service), create an // infoTemplate for the graphic features. Create // it only if one does not already exist. if (layer.capabilities && array.indexOf(layer.capabilities.toLowerCase(), 'data') < 0) {
The layer.capabilites returned from ArcGIS Server is a comma-separated string, not an array. array.indexOf will always return -1.
I recommend changing it to:
if (layer.capabilities && layer.capabilities.toLowerCase().indexOf('data') < 0) {
The end result is that an unnecessary block of code is run to create new infotemplates from the REST service endpoint for the layer, not from the data already returned by the features. This became apparent when Lex noted that results for one service didn't include links. The data had the links, but the rest endpoint list of fields for the layer did not, so it wasn't in the info template, and thus the links aren't shown, even though they're there in the feature's (graphic object) attributes.