View Issue Details

IDProjectCategoryView StatusLast Update
0000311GORM[Adventure PHP Framework] Code-Verbesserung // Code improvementpublic2017-08-28 09:30
Reporterthalo1Assigned ToChristianAchatz 
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionwon't fix 
Product Version 
Target Version[Adventure PHP Framework] 3.4Fixed in Version[Adventure PHP Framework] 3.4 
Summary0000311: Improve GenericORRelationMapper::saveObject for easier use with form-to-model mapping
DescriptionA simple form for create or edit objects like those as in UMGT leads to a mapping of an empty string for UserID (in the create form), and thus in an update query.

<html:form name="User">
   <form:text name="UserName" />
   <form:hidden name="UserID" />
   <form:button name="send" value="send" />
</html:form>

Because of the check on null, this never leads to a new record.
Additional InformationIn order to simplify the mapping, replace the following in modules/genericormapper/data/GenericORMapper:362

if ($id === null)

with

if (empty($id))
TagsNo tags attached.
Codereferenz: ([Datei]:[Zeile])

Activities

ChristianAchatz

2016-10-04 17:57

administrator   ~0000749

Last edited: 2016-10-04 17:58

View 2 revisions

Thanks for submitting this request!

Can you try mapping the form content to the DTO/model applying a list of fields to map with the fillModell() method?

thalo1

2016-10-04 18:36

reporter   ~0000750

This would also work.

ChristianAchatz

2016-10-05 08:23

administrator   ~0000751

Great news! Then I'd suggest to leave the implementation as-is since "null" is used as a type-safe indicator that the object has not been saved. Agree?

ChristianAchatz

2016-11-27 18:58

administrator   ~0000756

Thalo,

any feedback for me? Would be great! :)

ChristianAchatz

2017-08-28 09:30

administrator   ~0000787

Closing issue since "null" is an explicit indicator.

Issue History

Date Modified Username Field Change
2016-10-04 01:06 thalo1 New Issue
2016-10-04 17:57 ChristianAchatz Note Added: 0000749
2016-10-04 17:58 ChristianAchatz Note Edited: 0000749 View Revisions
2016-10-04 18:36 thalo1 Note Added: 0000750
2016-10-05 08:23 ChristianAchatz Note Added: 0000751
2016-11-27 18:58 ChristianAchatz Note Added: 0000756
2017-08-28 09:30 ChristianAchatz Note Added: 0000787
2017-08-28 09:30 ChristianAchatz Status new => closed
2017-08-28 09:30 ChristianAchatz Assigned To => ChristianAchatz
2017-08-28 09:30 ChristianAchatz Resolution open => won't fix
2017-08-28 09:30 ChristianAchatz Fixed in Version => 3.4
2017-08-28 09:30 ChristianAchatz Target Version => 3.4