DOI-USGS / gems-tools-pro

GeMS Tools for ArcGIS Pro
Creative Commons Zero v1.0 Universal
46 stars 15 forks source link

for fixStrings, add editor and workspace in fixTableStrings #84

Closed dmirandaUSGS closed 1 year ago

dmirandaUSGS commented 1 year ago

FixStrings silently fails if a feature class participates in a topology class, that feature class is just skipped entirely and no error messages are thrown. Additionally, the tool can't update feature classes with active attribute rules as mentioned in the ReadMe.

After some research, it looks like you need to wrap the UpdateCursor in an Editor Session.

See the following: attribute rule error on update cursor

Objects in this class cannot be updated outside an edit session

Note for that second link, I did not actually see the error, but it does specifically state that feature classes in a topology cannot be edited unless they are in an edit session.

So, I made a couple small changes to add an Editor to the script and tested it both with a feature class that participates in topology as well as one that had active attribute rules and the script works. Note that I did not change anything in the ReadMe about the limitation with attribute rules. It's probably worth more extensive testing before knowing for sure it was fixed.

ethoms-usgs commented 1 year ago

Tested with a feature class in topology and works as expected. Thanks!