Skip to content
Snippets Groups Projects
Commit 070cb4bf authored by Jared Hancock's avatar Jared Hancock
Browse files

forms: Better failsafe for __toString

This mostly helps when fields change types. If the type of the field
currently cannot convert previous data to a string (like if a short-answer
field was changed to choices), the textual representation of the PHP value
of the field data is given.
parent 4fa5406f
Branches
Tags
No related merge requests found
...@@ -729,7 +729,8 @@ class DynamicFormEntryAnswer extends VerySimpleModel { ...@@ -729,7 +729,8 @@ class DynamicFormEntryAnswer extends VerySimpleModel {
} }
function __toString() { function __toString() {
return $this->toString(); $v = $this->toString();
return is_string($v) ? $v : (string) $this->getValue();
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment