diff --git a/inc/field/actorfield.class.php b/inc/field/actorfield.class.php index 8a9648bf0..dcf2c71e0 100644 --- a/inc/field/actorfield.class.php +++ b/inc/field/actorfield.class.php @@ -213,7 +213,7 @@ public function getValueForDesign(): string { return implode("\r\n", $value); } - public function getValueForTargetText($richText): string { + public function getValueForTargetText($richText): ?string { $value = []; foreach ($this->value as $item) { if (filter_var($item, FILTER_VALIDATE_EMAIL) !== false) { diff --git a/inc/field/checkboxesfield.class.php b/inc/field/checkboxesfield.class.php index 8199bfda9..e45a6facd 100644 --- a/inc/field/checkboxesfield.class.php +++ b/inc/field/checkboxesfield.class.php @@ -276,7 +276,7 @@ public function hasInput($input): bool { return isset($input['formcreator_field_' . $this->question->getID()]); } - public function getValueForTargetText($richText): string { + public function getValueForTargetText($richText): ?string { $value = []; $values = $this->getAvailableValues(); diff --git a/inc/field/datefield.class.php b/inc/field/datefield.class.php index 775679797..2a48ee469 100644 --- a/inc/field/datefield.class.php +++ b/inc/field/datefield.class.php @@ -116,7 +116,7 @@ public function getValueForDesign(): string { return $this->value; } - public function getValueForTargetText($richText): string { + public function getValueForTargetText($richText): ?string { return Html::convDate($this->value); } diff --git a/inc/field/datetimefield.class.php b/inc/field/datetimefield.class.php index 2a8c1af2b..dfe130801 100644 --- a/inc/field/datetimefield.class.php +++ b/inc/field/datetimefield.class.php @@ -122,7 +122,7 @@ public function hasInput($input): bool { return isset($input['formcreator_field_' . $this->question->getID()]); } - public function getValueForTargetText($richText): string { + public function getValueForTargetText($richText): ?string { return Html::convDateTime($this->value); } diff --git a/inc/field/descriptionfield.class.php b/inc/field/descriptionfield.class.php index ec8836a89..1486ab533 100644 --- a/inc/field/descriptionfield.class.php +++ b/inc/field/descriptionfield.class.php @@ -71,7 +71,7 @@ public function getValueForDesign(): string { return ''; } - public function getValueForTargetText($richText): string { + public function getValueForTargetText($richText): ?string { $text = $this->question->fields['description']; if (!$richText) { $text = nl2br(strip_tags(html_entity_decode($text))); diff --git a/inc/field/dropdownfield.class.php b/inc/field/dropdownfield.class.php index d4d33a0db..845a63204 100644 --- a/inc/field/dropdownfield.class.php +++ b/inc/field/dropdownfield.class.php @@ -412,7 +412,7 @@ public function getValueForDesign(): string { return $this->value; } - public function getValueForTargetText($richText): string { + public function getValueForTargetText($richText): ?string { $DbUtil = new DbUtils(); $itemtype = $this->getSubItemtype(); if ($itemtype == User::class) { diff --git a/inc/field/filefield.class.php b/inc/field/filefield.class.php index fdb80a656..0a167dfb4 100644 --- a/inc/field/filefield.class.php +++ b/inc/field/filefield.class.php @@ -101,7 +101,7 @@ public function getValueForDesign(): string { return ''; } - public function getValueForTargetText($richText): string { + public function getValueForTargetText($richText): ?string { return $this->value; } diff --git a/inc/field/floatfield.class.php b/inc/field/floatfield.class.php index 1c603865a..719ce780f 100644 --- a/inc/field/floatfield.class.php +++ b/inc/field/floatfield.class.php @@ -125,7 +125,7 @@ public function getValueForDesign(): string { return $this->value; } - public function getValueForTargetText($richText): string { + public function getValueForTargetText($richText): ?string { return $this->value; } diff --git a/inc/field/hiddenfield.class.php b/inc/field/hiddenfield.class.php index e352e69fe..86038e953 100644 --- a/inc/field/hiddenfield.class.php +++ b/inc/field/hiddenfield.class.php @@ -110,7 +110,7 @@ public static function getName(): string { return _n('Hidden field', 'Hidden fields', 1); } - public function getValueForTargetText($richText): string { + public function getValueForTargetText($richText): ?string { return str_replace("\n", '\r\n', $this->value); } diff --git a/inc/field/hostnamefield.class.php b/inc/field/hostnamefield.class.php index e2fcd6e84..c74cac41e 100644 --- a/inc/field/hostnamefield.class.php +++ b/inc/field/hostnamefield.class.php @@ -87,7 +87,7 @@ public function getValueForDesign(): string { return ''; } - public function getValueForTargetText($richText): string { + public function getValueForTargetText($richText): ?string { return $this->value; } diff --git a/inc/field/ipfield.class.php b/inc/field/ipfield.class.php index 602569c2b..93ee71e7a 100644 --- a/inc/field/ipfield.class.php +++ b/inc/field/ipfield.class.php @@ -95,7 +95,7 @@ public function getValueForDesign(): string { return $this->value; } - public function getValueForTargetText($richText): string { + public function getValueForTargetText($richText): ?string { return $this->value; } diff --git a/inc/field/radiosfield.class.php b/inc/field/radiosfield.class.php index 58c5ee2d1..4ab1e4901 100644 --- a/inc/field/radiosfield.class.php +++ b/inc/field/radiosfield.class.php @@ -216,7 +216,7 @@ public function getValueForDesign(): string { return $this->value; } - public function getValueForTargetText($richText): string { + public function getValueForTargetText($richText): ?string { return $this->value; } diff --git a/inc/field/requesttypefield.class.php b/inc/field/requesttypefield.class.php index f1bbec33c..02819d4a5 100644 --- a/inc/field/requesttypefield.class.php +++ b/inc/field/requesttypefield.class.php @@ -170,7 +170,7 @@ public function hasInput($input): bool { return isset($input['formcreator_field_' . $this->question->getID()]); } - public function getValueForTargetText($richText): string { + public function getValueForTargetText($richText): ?string { $available = $this->getAvailableValues(); return $available[$this->value]; } diff --git a/inc/field/tagfield.class.php b/inc/field/tagfield.class.php index ff2d3ed3a..bbe41f4a1 100644 --- a/inc/field/tagfield.class.php +++ b/inc/field/tagfield.class.php @@ -145,7 +145,7 @@ public function getValueForDesign(): string { return implode("\r\n", $this->value); } - public function getValueForTargetText($richText): string { + public function getValueForTargetText($richText): ?string { $value = Dropdown::getDropdownName(PluginTagTag::getTable(), $this->value); return $value; } diff --git a/inc/field/textareafield.class.php b/inc/field/textareafield.class.php index e753097e4..a46e3d504 100644 --- a/inc/field/textareafield.class.php +++ b/inc/field/textareafield.class.php @@ -214,7 +214,7 @@ public function parseAnswerValues($input, $nonDestructive = false): bool { return true; } - public function getValueForTargetText($richText): string { + public function getValueForTargetText($richText): ?string { $value = $this->value; if (!$richText) { $value = Toolbox::unclean_cross_side_scripting_deep($value); diff --git a/inc/field/textfield.class.php b/inc/field/textfield.class.php index 4678a4e06..101b3f2c8 100644 --- a/inc/field/textfield.class.php +++ b/inc/field/textfield.class.php @@ -130,7 +130,7 @@ public function getValueForDesign(): string { return $this->value; } - public function getValueForTargetText($richText): string { + public function getValueForTargetText($richText): ?string { return $this->value; } diff --git a/inc/field/timefield.class.php b/inc/field/timefield.class.php index 9c45d4bef..3f326a003 100644 --- a/inc/field/timefield.class.php +++ b/inc/field/timefield.class.php @@ -117,7 +117,7 @@ public function getValueForDesign(): string { return $this->value; } - public function getValueForTargetText($richText): string { + public function getValueForTargetText($richText): ?string { $date = DateTime::createFromFormat("H:i:s", $this->value); if ($date === false) { return ' '; diff --git a/inc/field/urgencyfield.class.php b/inc/field/urgencyfield.class.php index 1fcaf5edb..f8cfa6533 100644 --- a/inc/field/urgencyfield.class.php +++ b/inc/field/urgencyfield.class.php @@ -174,7 +174,7 @@ public function getValueForDesign(): string { return $this->value; } - public function getValueForTargetText($richText): string { + public function getValueForTargetText($richText): ?string { $available = $this->getAvailableValues(); return $available[$this->value]; } diff --git a/inc/fieldinterface.class.php b/inc/fieldinterface.class.php index 1deaabcd3..849f619c5 100644 --- a/inc/fieldinterface.class.php +++ b/inc/fieldinterface.class.php @@ -116,7 +116,7 @@ public function getValueForDesign() : string; * * @return string */ - public function getValueForTargetText($richText) : string; + public function getValueForTargetText($richText): ?string; /** * Move uploaded files and make Document items diff --git a/tests/fixture/PluginFormcreatorDependentField.php b/tests/fixture/PluginFormcreatorDependentField.php index e1dd37149..5f88b7e1e 100644 --- a/tests/fixture/PluginFormcreatorDependentField.php +++ b/tests/fixture/PluginFormcreatorDependentField.php @@ -161,7 +161,7 @@ public function getValueForDesign(): string { return $this->value; } - public function getValueForTargetText($richText): string { + public function getValueForTargetText($richText): ?string { return Toolbox::addslashes_deep($this->value); }