Skip to content

PRESIDECMS-2949 Existing oneToManyConfigurator field value does not show when editing#1541

Open
teonator wants to merge 2 commits intostablefrom
feature-PRESIDECMS-2949_existing-onetomanyconfigurator-field-value-does-not-show-when-editing
Open

PRESIDECMS-2949 Existing oneToManyConfigurator field value does not show when editing#1541
teonator wants to merge 2 commits intostablefrom
feature-PRESIDECMS-2949_existing-onetomanyconfigurator-field-value-does-not-show-when-editing

Conversation

@teonator
Copy link
Contributor

@teonator teonator commented Oct 9, 2024

No description provided.

@github-actions
Copy link

github-actions bot commented Oct 9, 2024

Test Results

    1 files  ±0    109 suites  ±0   2m 35s ⏱️ -12s
1 734 tests ±0  1 731 ✅ ±0  3 💤 ±0  0 ❌ ±0 
1 737 runs  ±0  1 734 ✅ ±0  3 💤 ±0  0 ❌ ±0 

Results for commit bd75705. ± Comparison against base commit ff2c071.

♻️ This comment has been updated with latest results.

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" ] ?: "" );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This naming seems the wrong way around? isEdit should be = !isEmptyString( ... )? and then the logic below would be if ( isEdit || isTrue( sourceProperty.cloneable...?

I wonder should it all be simpler and just use if ( !StructIsEmpty( args.savedData ) )? i.e. if we have saved data, whether cloning or editing, then we should prepopulate?

I'm curious that this would not have been picked up previously re the bug in general. Wonder if @sebduggan has any thoughts here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue was only introduced with the previous bugfix from last month...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am afraid we cannot use !StructIsEmpty(args.savedData) because the cloned args.savedData is not empty, but it is missing datecreated and datemodified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants