diff --git a/CHANGELOG.md b/CHANGELOG.md index a2ae3915..35c9c423 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Deletes are now properly owned by the user who did the delete (#729) - Pull page output now displays better when pull preview shows a lot of changes (#740) +- Fixed loop of loading classes with compilation errors in Studio (#766) +- Fixed error popup when creating new record map or other interop items (#753) ## [2.11.0] - 2025-04-23 diff --git a/cls/SourceControl/Git/Production.cls b/cls/SourceControl/Git/Production.cls index 5b08c145..c40c1eeb 100644 --- a/cls/SourceControl/Git/Production.cls +++ b/cls/SourceControl/Git/Production.cls @@ -380,10 +380,24 @@ ClassMethod IsProductionClass(className As %String, nameMethod As %String) As %B if ##class(%File).Exists(settingsPTDFilename) { return 1 } - // check if there is a class export for this Production, load it for class definition + // uses temporary flag to load item without loading into database (since the item may not be + // compilable or not have been intended for import yet). Then check for Production Definition + // XData. Approach taken from CvtXmlToClientDoc method in %Api.Atelier.v1 set filename = $classmethod(##class(%Studio.SourceControl.Interface).SourceControlClassGet(), nameMethod, className_".CLS") - if ##class(%File).Exists(filename) && (##class(%File).GetFileSize(filename) '= 0) { - $$$ThrowOnError($System.OBJ.Load(filename)) + if ##class(%File).Exists(filename) && '##class(%File).DirectoryExists(filename) && (##class(%File).GetFileSize(filename) '= 0) { + try { + set ^||%oddDEF=1 + $$$ThrowOnError($system.OBJ.Load(filename, "-d")) + // class XDatas are stored in ^||%oddDEF("","x","") after temp load + set hasProdDef = $data(^||%oddDEF(className,$$$cCLASSxdata,"ProductionDefinition")) + kill ^||%oddDEF + if hasProdDef { + return 1 + } + } catch err { + kill ^||%oddDEF + throw err + } } // if Production exists as a class definition on the server, check if extending Ens.Production set classDef = ##class(%Dictionary.ClassDefinition).%OpenId(className) diff --git a/cls/SourceControl/Git/Utils.cls b/cls/SourceControl/Git/Utils.cls index ce372070..564f3562 100644 --- a/cls/SourceControl/Git/Utils.cls +++ b/cls/SourceControl/Git/Utils.cls @@ -1251,9 +1251,12 @@ ClassMethod IsInSourceControl(InternalName As %String, ByRef sourceControlItem A quit isInSourceControl } -ClassMethod FullExternalName(ByRef InternalName As %String, ByRef MappingExists As %Boolean) As %String [ CodeMode = expression ] +ClassMethod FullExternalName(ByRef InternalName As %String, ByRef MappingExists As %Boolean) As %String { -..TempFolder()_..ExternalName(.InternalName, .MappingExists) + set externalName = ..ExternalName(.InternalName, .MappingExists) + return $select( + externalName="":"", + 1: ..TempFolder()_externalName) } ClassMethod NormalizeInternalName(ByRef name As %String, Output fromWebApp As %Boolean = 0, Output cspFilename) As %String @@ -3198,4 +3201,3 @@ ClassMethod IsSchemaStandard(pName As %String = "") As %Boolean [ Internal ] } } -