Skip to content

NameToInternalName on LUT (for example) could convert _ to % #588

Closed
@isc-tleavitt

Description

@isc-tleavitt

SourceControl.Git.Utils:NameToInternalName could potentially switch _ to % on import of a lookup table (.LUT) document:

        if (InternalName="") {
            //take our best guess based on the document extension mapped to that subdirectory
            set nam=$piece(nam,".",1,*-1)
            set nam=$replace(nam, ..PercentClassReplace(), "%")
            set nam=$translate(nam,"/",".")
            set InternalName=nam_"."_fileExt
            if (fileExt="cls") {
                // special handling for possible collissions between % and non-% classes of the same name
                set alternateInternalName="%"_InternalName
                set primaryExists=##class(%RoutineMgr).Exists(InternalName), alternateExists=##class(%RoutineMgr).Exists(alternateInternalName)
                if ('primaryExists)&&(alternateExists) { set InternalName=alternateInternalName }	// it must have been a %-class as one by that name exists
                if (primaryExists)&&(alternateExists) { quit "" }	//indeterminate as the class exists in % and non-% form in the DB
            }
        }

I haven't reproduced this but it seems like the only path to explain what's happening. PercentClassReplace should only apply to classes/routines/include files, not user types and definitely not automatically reverse-translating.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcustomerBased on customer feedback (as opposed to something identified by developers)

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions