Note, that before you ‘fix’ the actual link types, you need to fix the links using the ‘bad’ link types.
I tried just renaming the link types. It appears to work but on re-closing/re-opening the app/doc the ‘bad’ typed links and link types are still there.
You could use linkTo() and UnlinkTo(0 to delete make new links of the good link type and delete links of the bad type, then check explicitly for any use of the bad type. But, with 4k ‘bad’ links using BBEDit or similar is faster cleaner. Here is link data from a small TBX where the above bug has cloned link type text
to "test"
and ""test""
:
In the above there is a single link each of the ‘correct’ test’ and each of the quote-enclosed versions. Here is the link types listing for the same doc:
So, first we fix the links. We use Find & Replace in BBEdit (you can use a similar tool):
Note the ‘find’ regex matches ‘bad’ type variants using one or two sets of enclosing straight double quotes. It the bug had run away such that you had types like """""""test"""""""
the regex would match those two as (")+
matches one or more consecutive instances of string "+
. Make sure you replace the ‘bad’ data both before and after the link type name.
Don’t forget to work the fix on a copy of the original TBX file in case you mess up.
After running the replace is run, notice on;y the correct test
link type is used:
In the Link type inspector select the ‘bad’ link types like "test"
and delete them as no links now use that link types. So compared the grab above, the link type listing the TBX’s XML will look like:
Save the edited TBX, close, re-opening in Tinderbox and check all looks OK.
@eastgate. I may be missing a complication, but it would be useful if I could rename a Link Type defined in a TBX to the name of an existing link type and essentially do the rename and ‘merge’ above in-app. I can see it might be one of the few places where an “are you sure” dialog might be warranted before merging two linkTypes’s worth of links to use just one link type.
For now as the issue raised is a glitch only affecting those who used a particular Backstage beta build, the BBEdit approach to a fix should suffice as once done using a public release won’t re-trigger the issue.