APF-Tracker

Adventure PHP Framework Issue Management


View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000311GORM[Adventure PHP Framework] Code-Verbesserung // Code improvementpublic2016-10-04 01:062016-11-27 18:58
Reporterthalo1 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusnewResolutionopen 
Product Version 
Target VersionFixed in Version 
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])
Attached Files

- Relationships

-  Notes
(0000749)
ChristianAchatz (administrator)
2016-10-04 17:57
edited on: 2016-10-04 17:58

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?

(0000750)
thalo1 (reporter)
2016-10-04 18:36

This would also work.
(0000751)
ChristianAchatz (administrator)
2016-10-05 08:23

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?
(0000756)
ChristianAchatz (administrator)
2016-11-27 18:58

Thalo,

any feedback for me? Would be great! :)

- 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


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker