Anonymous Login
2019-10-20 19:15 PDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001229v3.0 Release[All Projects] Generalpublic2013-08-28 11:17
Reporterlolcode 
Assigned Tocaseydk 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
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

-Relationships
+Relationships

+Notes

-Issue History
Date Modified Username Field Change
2012-12-19 12:06 lolcode New Issue
2012-12-22 22:30 caseydk Project v2.4 Release (Closed) => v3.0 Release
2012-12-22 22:31 caseydk Note Added: 0002757
2012-12-22 22:31 caseydk Status new => resolved
2012-12-22 22:31 caseydk Resolution open => fixed
2012-12-22 22:31 caseydk Assigned To => caseydk
2013-08-28 11:14 caseydk Fixed in Version => 3.0.0
2013-08-28 11:17 caseydk Status resolved => closed
+Issue History