PluginProbe
The Innovative Form Builder – IvyForms / 1.5
The Innovative Form Builder – IvyForms v1.5
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
← All changes | backend/src/Common/Helpers/FieldHelper.php +20 -1 1.1 → 1.5 View file →
@@ -100,9 +100,9 @@
100 100 * @return bool
101 101 */
102 102 public static function fieldTypeHasOptions(string $fieldType): bool
103 103 {
104 - return in_array($fieldType, ['radio', 'checkbox', 'select', 'multi-select'], true);
104 + return in_array($fieldType, ['radio', 'checkbox', 'select', 'multi-select', 'product', 'rating'], true);
105 105 }
106 106
107 107 /**
108 108 * Check if a field type is a security/CAPTCHA field.
@@ -157,6 +157,25 @@
157 157 'field'
158 158 );
159 159 $fieldData['htmlContent'] = $processedContent;
160 160 }
161 + }
162 +
163 + /**
164 + * Upload base64 images in rich text default values before form save.
165 + *
166 + * @param array<string, mixed> $fieldData Passed by reference; defaultValue modified in place
167 + * @param ImageService $imageService
168 + * @return void
169 + */
170 + public static function processRichTextDefaultValue(array &$fieldData, ImageService $imageService): void
171 + {
172 + if (($fieldData['type'] ?? '') !== 'rich_text' || empty($fieldData['defaultValue'])) {
173 + return;
174 + }
175 +
176 + $fieldData['defaultValue'] = $imageService->processImagesInContent(
177 + (string) $fieldData['defaultValue'],
178 + 'field'
179 + );
161 180 }
162 181 }