PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 2.15.3
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v2.15.3
3.3.1 V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 All 138 releases
← All changes | includes/Core/WorkFlow/Helper.php +3 -33 3.1.22.15.3 View file →
@@ -13,12 +13,11 @@
13 13 {
14 14 $fieldData = [];
15 15
16 16 foreach ($fields as $fieldKey => $fieldDetail) {
17 - $value = isset($fieldDetail->val) ? $fieldDetail->val : (isset($fieldDetail->defaultValue) ? $fieldDetail->defaultValue : '');
18 17 $fieldData[$fieldKey] = [
19 18 'key' => $fieldKey,
20 - 'value' => $value,
19 + 'value' => empty($fieldDetail->val) ? '' : $fieldDetail->val,
21 20 'type' => $fieldDetail->typ,
22 21 ];
23 22 if (isset($fieldDetail->mul)) {
24 23 $fieldData[$fieldKey] =
@@ -55,11 +54,11 @@
55 54 }
56 55 return $fieldData;
57 56 }
58 57
59 - public static function replaceFieldWithValue($stringToReplaceField, $fieldValues, $evalMathExpr = true, $formID = null)
58 + public static function replaceFieldWithValue($stringToReplaceField, $fieldValues, $evalMathExpr = true)
60 59 {
61 - $stringToReplaceField = FieldValueHandler::replaceFieldWithValue($stringToReplaceField, $fieldValues, $formID);
60 + $stringToReplaceField = FieldValueHandler::replaceFieldWithValue($stringToReplaceField, $fieldValues);
62 61 if ($evalMathExpr) {
63 62 return self::evalMathExpression($stringToReplaceField);
64 63 }
65 64 return $stringToReplaceField;
@@ -248,35 +247,6 @@
248 247 '^' => $firstOperand ** $secondOperand,
249 248 ];
250 249
251 250 return isset($calculated[$operator]) ? $calculated[$operator] : '';
252 - }
253 -
254 - /**
255 - * Recursively sets a nested property in a given object.
256 - *
257 - * This function takes an object, a string path representing nested properties
258 - * (e.g., "fk->valid->hide"), and a value to assign. It ensures that all
259 - * intermediate properties exist as objects before setting the final value.
260 - *
261 - * @param object $object The main object where properties should be set.
262 - * @param string $path The nested property path, with keys separated by "->".
263 - * @param mixed $value The value to assign to the final property.
264 - *
265 - * @return void
266 - */
267 - public static function setNestedProperty(&$object, $path, $value)
268 - {
269 - $keys = explode('->', $path);
270 - $key = array_shift($keys);
271 -
272 - if (!isset($object->$key) || !is_object($object->$key)) {
273 - $object->$key = new \stdClass();
274 - }
275 -
276 - if (!empty($keys)) {
277 - self::setNestedProperty($object->$key, implode('->', $keys), $value);
278 - } else {
279 - $object->$key = $value;
280 - }
281 251 }
282 252 }