In-Portal Issue Tracker - In-Portal CMS
|
||||||||||||||||||||||||||||||
Viewing Issue Advanced Details | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
ID: | Category: | Type: | Reproducibility: | Date Submitted: | Last Update: | |||||||||||||||||||||||||
271 | [In-Portal CMS] Data Management | feature request | N/A | 2009-09-04 15:28 | 2012-07-25 05:32 | |||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
Reporter: | alex | Platform: | ||||||||||||||||||||||||||||
Assigned To: | alex | OS: | ||||||||||||||||||||||||||||
Priority: | normal | OS Version: | ||||||||||||||||||||||||||||
Status: | closed | Product Version: | 5.1.0 | |||||||||||||||||||||||||||
Product Build: | Resolution: | fixed | ||||||||||||||||||||||||||||
ETA: | none | Fixed in Version: | 5.2.0-B1 | |||||||||||||||||||||||||||
Reference: | https://groups.google.com/d/topic/in-portal-dev/cfhRH6VUxaE/discussion | |||||||||||||||||||||||||||||
Change Log Message: | ||||||||||||||||||||||||||||||
Estimate Points: | 3 | |||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
Summary: | 0000271: Redesign "Data Validation" Engine | |||||||||||||||||||||||||||||
Description: |
Here is form data processing cycle from user to database: 1. user opens editing template and inputs form data into form fields; 2. user presses save button to place it's changes to database; 3. form data is passed to kDBItem (or it's descendant) class for processing; 4. class kDBItem (or it's descendant) uses kDBItem::Validate method to validate data before saving to database; 5. internally validation is performed using options defined for each field in it's declaration (all fields are validated, no matter what fields were submitted from form); 6. based on validation results user is either returned to form with validation errors displayed or editing window is successfully closed. This approach has several not obvious weaknesses: 1. all fields are validated, instead of submitted only fields - this takes time, when not all possible fields are displayed on form; 2. validation rules are defined directly in field declaration in unit config - this doesn't allow form-based validation rules on base level (but can be done inside event handler as usual). Idea is to move all validation-related field options to form declaration (see task 0000270) and submit used form name along with form fields to kDBItem class, that will use it to perform form-based validation. How to do this: 1. create kValidator class (with one public method named ValidateField) and move all validation-related code to it from kDBItem class; 2. add $form_name parameter to kDBItem::Validate and to kDBItem::ValidateField methods; 3. when $form_name parameter is not passed, then create (and cache) instance of kValidator class and use validation-related options from field declaration in unit config; 4. when $form_name parameter is passed, then create (and cache) instance of validator class, specified in form declaration and use validation-related options for given field from form declaration; 5. validate form fields using appropriate validator class and validation-related options. 4. create ValidatorClass unit config option (like ListClass option), that will allow to define custom validator class for given unit config and use it later in forms declared inside that unit config. This way compatibility with unit configs, that don't use forms, layouts will be preserved. Also side effect is, that less memory will be used, when data from several tables in displayed on same screen (front-end mostly). |
|||||||||||||||||||||||||||||
Steps To Reproduce: | ||||||||||||||||||||||||||||||
Additional Information: |
Form Usage: =========== You can define as many forms as you need in 'Forms' unit config option, e.g. 'Forms' => Array ( 'front_registration' => Array ( 'Fields' => Array ( 'FirstName' => Array ('required' => 1, 'default' => ''), ) ), ), In this example new form called 'front_registration' is created. Database field called 'FirstName' is made required on this form. If form called 'default' is also defined, then it is always applied first. You can override following unit config options from form declaration: - ItemSQLs - ListSQLs - Fields - CustomFields - VirtualFields - CalculatedFields - AggregatedCalculatedFields 1. to set form name in template use this tag <inp2:prefix.special_FormName name="front_registration"/> before any other tag of this prefix.special. 2. to pass form-name to next template after form submit place this hidden field on a form: <input type="hidden" name="forms[prefix.special]" value="<inp2:prefix.special_FormName/>"/> 3. to use custom validator class do this: - add 'ValidatorClass' => 'CustomValidator' to unit config - register class in factory |
|||||||||||||||||||||||||||||
Relationships |
| |||||||||||||||||||||||||||||
Attached Files: |
forms_core.patch (262,481) 2011-09-29 10:43 http://tracker.in-portal.org/file_download.php?file_id=1165&type=bug forms_modules.patch (65,519) 2011-09-29 10:43 http://tracker.in-portal.org/file_download.php?file_id=1166&type=bug forms_themes.patch (30,462) 2011-09-29 10:43 http://tracker.in-portal.org/file_download.php?file_id=1167&type=bug session_expiration_used_validatelogin_field.patch (2,343) 2011-09-29 14:57 http://tracker.in-portal.org/file_download.php?file_id=1169&type=bug user_autologin_after_registration_fix.patch (784) 2012-01-03 10:53 http://tracker.in-portal.org/file_download.php?file_id=1455&type=bug |
|||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
Issue History | ||||||||||||||||||||||||||||||
Date Modified | Username | Field | Change | |||||||||||||||||||||||||||
2012-07-25 05:32 | alex | Note Added: 0005006 | ||||||||||||||||||||||||||||
2012-07-25 05:32 | alex | Status | resolved => closed | |||||||||||||||||||||||||||
2012-01-03 10:55 | alex | Changeset attached | 5.2.x r14971 | |||||||||||||||||||||||||||
2012-01-03 10:53 | alex | File Added: user_autologin_after_registration_fix.patch | ||||||||||||||||||||||||||||
2011-10-22 05:36 | alex | Estimate Points | => 3 | |||||||||||||||||||||||||||
2011-09-29 14:58 | alex | Changeset attached | 5.2.x r14599 | |||||||||||||||||||||||||||
2011-09-29 14:57 | alex | File Added: session_expiration_used_validatelogin_field.patch | ||||||||||||||||||||||||||||
2011-09-29 10:46 | alex | Note Added: 0003937 | ||||||||||||||||||||||||||||
2011-09-29 10:46 | alex | Status | reviewed and tested => resolved | |||||||||||||||||||||||||||
2011-09-29 10:46 | alex | Fixed in Version | => 5.2.0-B1 | |||||||||||||||||||||||||||
2011-09-29 10:46 | alex | Resolution | open => fixed | |||||||||||||||||||||||||||
2011-09-29 10:46 | alex | Assigned To | !COMMUNITY => alex | |||||||||||||||||||||||||||
2011-09-29 10:46 | alex | Changeset attached | 5.2.x r14596 | |||||||||||||||||||||||||||
2011-09-29 10:45 | alex | Changeset attached | 5.2.x r14595 | |||||||||||||||||||||||||||
2011-09-29 10:45 | alex | Changeset attached | 5.2.x r14594 | |||||||||||||||||||||||||||
2011-09-29 10:44 | alex | Changeset attached | 1.2.x r14593 | |||||||||||||||||||||||||||
2011-09-29 10:44 | alex | Note Added: 0003936 | ||||||||||||||||||||||||||||
2011-09-29 10:44 | alex | Status | needs testing => reviewed and tested | |||||||||||||||||||||||||||
2011-09-29 10:43 | alex | Time Estimate Removed | 1 => | |||||||||||||||||||||||||||
2011-09-29 10:43 | alex | Note Added: 0003935 | ||||||||||||||||||||||||||||
2011-09-29 10:43 | alex | Assigned To | => !COMMUNITY | |||||||||||||||||||||||||||
2011-09-29 10:43 | alex | Developer | => alex | |||||||||||||||||||||||||||
2011-09-29 10:43 | alex | Status | active => needs testing | |||||||||||||||||||||||||||
2011-09-29 10:43 | alex | File Added: forms_themes.patch | ||||||||||||||||||||||||||||
2011-09-29 10:43 | alex | File Added: forms_modules.patch | ||||||||||||||||||||||||||||
2011-09-29 10:43 | alex | File Added: forms_core.patch | ||||||||||||||||||||||||||||
2011-09-28 12:11 | alex | Note Edited: 0003755 | bug_revision_view_page.php?bugnote_id=0003755#r856 | |||||||||||||||||||||||||||
2011-09-27 06:27 | alex | Time Estimate Added | 1 | |||||||||||||||||||||||||||
2011-09-25 09:32 | alex | Relationship added | related to 0000351 | |||||||||||||||||||||||||||
2011-09-17 05:07 | alex | Note Added: 0003755 | ||||||||||||||||||||||||||||
2011-08-13 07:49 | alex | Additional Information Updated | bug_revision_view_page.php?rev_id=797#r797 | |||||||||||||||||||||||||||
2011-08-10 05:08 | alex | Relationship added | related to 0001095 | |||||||||||||||||||||||||||
2011-08-04 10:18 | alex | Relationship replaced | related to 0000951 | |||||||||||||||||||||||||||
2011-08-04 10:18 | alex | Relationship added | parent of 0000951 | |||||||||||||||||||||||||||
2011-07-28 04:02 | alex | Additional Information Updated | bug_revision_view_page.php?rev_id=786#r786 | |||||||||||||||||||||||||||
2011-07-27 10:46 | alex | Note Edited: 0003642 | bug_revision_view_page.php?bugnote_id=0003642#r784 | |||||||||||||||||||||||||||
2011-07-27 06:41 | alex | Note Edited: 0003642 | bug_revision_view_page.php?bugnote_id=0003642#r783 | |||||||||||||||||||||||||||
2011-07-27 05:52 | alex | Note Added: 0003642 | ||||||||||||||||||||||||||||
2011-07-08 10:58 | alex | Target Version | Icebox => 5.2.0 | |||||||||||||||||||||||||||
2011-07-05 15:39 | Dmitry | Reference | => https://groups.google.com/d/topic/in-portal-dev/cfhRH6VUxaE/discussion | |||||||||||||||||||||||||||
2010-08-31 14:26 | alex | version | => 5.1.0 | |||||||||||||||||||||||||||
2009-09-05 09:15 | alex | Summary | Redesign "Data Dalidation" Engine => Redesign "Data Validation" Engine | |||||||||||||||||||||||||||
2009-09-04 17:14 | Dmitry | Fixed in Version | Icebox => | |||||||||||||||||||||||||||
2009-09-04 17:14 | Dmitry | Target Version | => Icebox | |||||||||||||||||||||||||||
2009-09-04 17:13 | Dmitry | Category | Admin Interfaces => Data Management | |||||||||||||||||||||||||||
2009-09-04 17:13 | Dmitry | Fixed in Version | => Icebox | |||||||||||||||||||||||||||
2009-09-04 17:13 | Dmitry | Summary | Data validation engine redesign => Redesign "Data Dalidation" Engine | |||||||||||||||||||||||||||
2009-09-04 17:13 | Dmitry | Description Updated | bug_revision_view_page.php?rev_id=210#r210 | |||||||||||||||||||||||||||
2009-09-04 15:30 | alex | Relationship added | related to 0000269 | |||||||||||||||||||||||||||
2009-09-04 15:30 | alex | Relationship added | related to 0000270 | |||||||||||||||||||||||||||
2009-09-04 15:28 | alex | New Issue |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|