MantisBT - v3.0 Release
View Issue Details
0001229v3.0 Release[All Projects] Generalpublic2012-12-19 12:062013-08-28 11:17
Reporterlolcode 
Assigned Tocaseydk 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version3.0.0 
Summary0001229: Using the CProject class programmatically overwrites/loses custom fields when the store function is called
DescriptionMain issue: Class CProject assumes input values always come from $_POST:

if ($stored) {
   $custom_fields = new w2p_Core_CustomFields('projects', 'addedit', $this->project_id, 'edit');
   $custom_fields->bind($_POST);
   $sql = $custom_fields->store($this->project_id); // Store Custom Fields

   CTask::storeTokenTask($AppUI, $this->project_id);
}

Which in turn calls this which doesn't even check if the value is set before overwriting:
public function bind(&$formvars) {
  if (!count($this->fields) == 0) {
    foreach ($this->fields as $k => $v) {
       $this->fields[$k]->setValue(@$formvars[$k]);
    }
  }
}

Which in turn calls this in CustomField.php and that only works for character fields:
public function setValue($v) {
  $this->value_charvalue = $v;
}
TagsNo tags attached.
Attached Files

Notes
(0002757)
caseydk   
2012-12-22 22:31   
Resolved: https://github.com/caseysoftware/web2project/commit/a1d4ea6d032e72be760b7d0492c4a27f94f3eb7e

Issue History
2012-12-19 12:06lolcodeNew Issue
2012-12-22 22:30caseydkProjectv2.4 Release (Closed) => v3.0 Release
2012-12-22 22:31caseydkNote Added: 0002757
2012-12-22 22:31caseydkStatusnew => resolved
2012-12-22 22:31caseydkResolutionopen => fixed
2012-12-22 22:31caseydkAssigned To => caseydk
2013-08-28 11:14caseydkFixed in Version => 3.0.0
2013-08-28 11:17caseydkStatusresolved => closed