Skip to content

Commit

Permalink
fix(DBComponentField) Swapped to using getValue
Browse files Browse the repository at this point in the history
Using forTemplate causes some field types to change the underlying value when evaluating the returned data value (ie nl2br, or htmlencoding). This may be a convenient default for some things, but in a general sense causes terrible problems for things like form fields. Those areas that do need it can call the relevant things (like .ATT, .XML) from the template
  • Loading branch information
nyeholt committed Sep 13, 2024
1 parent 5f051e2 commit 546f927
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Symbiote/Components/DBComponentField.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,14 @@ public function __construct($name, array $fields)
// continue;
// }
//}
$value .= $field->forTemplate();

// NOTE(Marcus) 2019-02-20
//
// Have swapped this to just concating the raw value; it seems unusual to use
// forTemplate on a field because the result of this is normally formatted differently
// to the raw data which is very undesirable if the component decides to use the
// data in a different manner (ie, as a textarea field content)
$value .= $field->getValue();
}
$this->value = $value;
}
Expand Down

0 comments on commit 546f927

Please sign in to comment.