Skip to content

Fixes to preview load to determine if production decomposition applies #767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 17 additions & 3 deletions cls/SourceControl/Git/Production.cls
Original file line number Diff line number Diff line change
Expand Up @@ -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("<class name>","x","<XData name>") 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)
Expand Down
8 changes: 5 additions & 3 deletions cls/SourceControl/Git/Utils.cls
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -3198,4 +3201,3 @@ ClassMethod IsSchemaStandard(pName As %String = "") As %Boolean [ Internal ]
}

}

Loading