Error regarding duplicate names on patrol import: "Could not save patrol. A different object with the same identifier value was already associated with the session..."

A site we support got an error message stating:

“Could not save patrol. A different object with the same identifier value was already associated with the session: [$PatrolLegMemberPk@c15b134a]”

Upon inspection, they realized the error might have been due to duplication of employee names in the conservation area. In troubleshooting, it looks like someone imported an employee list and the employee names were duplicated rather than merged.

The recommendation was to clean up the employee list and try to import again, but this did not resolve the issue at first.

Investigating further with the SMART developer, they noted that this is an issue that has been resolved in the latest version of SMART 7 (v7.5, to be released very soon). This is updated in the latest version to only load one employee if the person is listed twice in a patrol that you are importing:

In 7.5 and newer versions, if you see this warning, you should clean up your duplicate employees, but it won’t stop the import from working before you do in 7.5.

In older versions, it will give you an error and you need to a) clean up duplicated in your employee list, and b) clean up any exported patrols that have the same name in them twice, this could happen when exporting patrols from a CA that had duplicate names at the time of export.

If you have already cleaned up the employee list and it still won’t import, there is a way to clean up the patrol package before you import it into SMART.

To do so, you must edit the xml file itself. It’s simple enough to edit, you just need to unzip the file, edit the xml file, remake the files into a Zip after you are done, and then then import that new Zip file you created. Here is a short video from the SMART developers to demonstrate the process: Edit_Patrol_Members.mp4 - Google Drive

NOTE: This is probably not viable if you have many patrols (eg, 30+), but if it’s just a few you can open the zip files and edit the members relatively easily.