Print digit - errors when a popup graphic is displayed for a point feature

Discussion created by mleahyesri-ca-esridist Employee on Sep 18, 2012
Latest reply on Sep 18, 2012 by DSwingley-esristaff
Hello all,

The problem described in the title is fairly easy to reproduce.  If you share a map using the basic map template, click on a point to show the associated popup, then click the print button, the response reported in a Firebug console from the execute path for the print task REST endpoint will contain an error like so:

{"error":{"code":400,"message":"Unable to complete operation.","details":["Error executing tool.: Layer \"map_graphics\": �?\nFailed to execute (Export Web Map).\nFailed to execute (Export Web Map Task)."]}}

This is followed by a bunch of errors reported in the JavaScript console that look like:

Error: Unable to complete operation.
Line 34

This only seems to occur when the popup is displayed for point features, and it appears to be specifically related to the graphic that is added to the map to highlight the clicked feature.  If you run the following line in the console after clicking on a point (while keeping the popup open), you can remove the highlight graphic from the map, then click the print button and everything will work fine:;

You can easily try this by opening the following web map using the basic viewer template:

If you click one of the trails on the map to show its popup, the print button will work fine.  If you click on one of the pavilions in the map (you may need to zoom in a bit due to their proximity to the trail), then try clicking the print luck.

The best workaround we can think of at the moment is to customize the print button such that it will remove the graphic from the map, and/or close the popup, before actually executing the print task.

Is there a better solution for this?