From 55734481253c97759480023a045b15419f965e55 Mon Sep 17 00:00:00 2001 From: Teon Ooi Date: Wed, 9 Oct 2024 12:45:28 +0800 Subject: [PATCH 1/2] [twgit] Init feature 'feature-PRESIDECMS-2949_existing-onetomanyconfigurator-field-value-does-not-show-when-editing'. From bd757054ff8b6f28d0b91935b17b8cfc505ee1cf Mon Sep 17 00:00:00 2001 From: Teon Ooi Date: Wed, 9 Oct 2024 12:48:10 +0800 Subject: [PATCH 2/2] PRESIDECMS-2949 Update to set default/ saved value when editing. --- system/handlers/formcontrols/OneToManyConfigurator.cfc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/handlers/formcontrols/OneToManyConfigurator.cfc b/system/handlers/formcontrols/OneToManyConfigurator.cfc index ddc99c1bf..e639810b2 100644 --- a/system/handlers/formcontrols/OneToManyConfigurator.cfc +++ b/system/handlers/formcontrols/OneToManyConfigurator.cfc @@ -10,6 +10,7 @@ component { var sourceIdField = presideObjectService.getIdField( args.sourceObject ); var sortOrderField = presideObjectService.getObjectAttribute( targetObject, "datamanagerSortField", "sort_order" ); var hasSortOrder = StructKeyExists( presideObjectService.getObjectProperties( targetObject ), sortOrderField ); + var isEdit = isEmptyString( args.savedData[ "datecreated" ] ?: "" ); args.labelRenderer = args.labelRenderer ?: presideObjectService.getObjectAttribute( targetObject, "labelRenderer" ); @@ -22,7 +23,7 @@ component { logError( e ); } - if ( isTrue( sourceProperty.cloneable ?: true ) ) { + if ( !isEdit || isTrue( sourceProperty.cloneable ?: true ) ) { args.defaultValue = args.savedValue = presideObjectService.getOneToManyConfiguratorJsonString( sourceObject = args.sourceObject , sourceId = args.savedData[ sourceIdField ] ?: ""