| @@ -284,11 +284,11 @@ | ||
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | private function getValuesFromQueryParams() |
| 287 | 287 | { |
| 288 | - $reqField = $_SERVER['QUERY_STRING']; | |
| 289 | 288 | $queryParamsValue = []; |
| 290 | - if (!empty($reqField)) { | |
| 289 | + if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) { | |
| 290 | + $reqField = $_SERVER['QUERY_STRING']; | |
| 291 | 291 | foreach (explode('&', $reqField) as $keyValue) { |
| 292 | 292 | // $pattern = '/([a-zA-Z0-9])([a-zA-Z])\=+/'; |
| 293 | 293 | $pattern = '/([^.]+)=(.*?)([^.]+)/'; |
| 294 | 294 | $matches = preg_match($pattern, $keyValue, $matchFormat); |
| @@ -315,8 +315,10 @@ | ||
| 315 | 315 | $formID = intval($atts['form_id']); |
| 316 | 316 | } |
| 317 | 317 | if (isset($atts['entry_id'])) { |
| 318 | 318 | $entryId = intval($atts['entry_id']); |
| 319 | + } elseif (isset($_GET['bf_entry_id'])) { | |
| 320 | + $entryId = $_GET['bf_entry_id']; | |
| 319 | 321 | } else { |
| 320 | 322 | $entryId = false; |
| 321 | 323 | } |
| 322 | 324 | if (isset($atts['id'])) { |
| @@ -374,13 +376,21 @@ | ||
| 374 | 376 | $nestedLayout = isset($formContent->nestedLayout) ? $formContent->nestedLayout : (object) []; |
| 375 | 377 | $buttons = !empty($formContent->buttons) ? $formContent->buttons : ''; |
| 376 | 378 | $additional = $formContent->additional; |
| 377 | 379 | |
| 378 | - $workFlowRunType = $entryId ? 'edit' : 'create'; | |
| 379 | - if ($entryId) { | |
| 380 | + // $workFlowRunType = $entryId ? 'edit' : 'create'; | |
| 381 | + if ($entryId && (get_current_user_id() || is_admin())) { | |
| 382 | + // return sprintf(__('Sorry!, You cannot edit #%s no form.', 'bit-form'), $formID); | |
| 383 | + $workFlowRunType = 'edit'; | |
| 380 | 384 | $fields = $this->setFieldsValue($fields, $formID, $entryId); |
| 385 | + } else { | |
| 386 | + $workFlowRunType = 'create'; | |
| 381 | 387 | } |
| 382 | 388 | |
| 389 | + // if ($entryId) { | |
| 390 | + // $fields = $this->setFieldsValue($fields, $formID, $entryId); | |
| 391 | + // } | |
| 392 | + | |
| 383 | 393 | $fields = apply_filters('bitform_filter_before_workflow_onload_fields', $fields, $formID); |
| 384 | 394 | $fields = $this->triggerWorkflowOnLoad($formID, $shortCodeCounter, $fields, $workFlowRunType); |
| 385 | 395 | $fields = apply_filters('bitform_filter_after_workflow_onload_fields', $fields, $formID); |
| 386 | 396 | do_action('bitform_onload_fields', $fields, $formID); |
| @@ -386,9 +396,9 @@ | ||
| 386 | 396 | do_action('bitform_onload_fields', $fields, $formID); |
| 387 | 397 | $workFlowreturnedOnUserInput = $this->executeOnUserInput($formID, $shortCodeCounter, $fields); |
| 388 | 398 | |
| 389 | 399 | // test for form before remove |
| 390 | - $noLabel = ['decision-box', 'html', 'button', 'paypal', 'razorpay', 'recaptcha']; | |
| 400 | + $noLabel = ['decision-box', 'html', 'shortcode', 'button', 'paypal', 'razorpay', 'recaptcha']; | |
| 391 | 401 | foreach ($fields as $fldKey => $field) { |
| 392 | 402 | if (!in_array($field->typ, $noLabel) && isset($field->lbl)) { |
| 393 | 403 | $lblReplaceToBackslash = str_replace('$_bf_$', '\\', $field->lbl); |
| 394 | 404 | $fields->{$fldKey}->lbl = FieldValueHandler::replaceSmartTagWithValue($lblReplaceToBackslash); |
| @@ -535,10 +545,10 @@ | ||
| 535 | 545 | $bitFormFrontArr['formInfo']->conversationalSettings = $formInfo->conversationalSettings; |
| 536 | 546 | } |
| 537 | 547 | |
| 538 | 548 | $formAbandonmentSettings = $FrontendFormManager->getFormAbandonmentSettings(); |
| 539 | - if(Helpers::property_exists_nested($formAbandonmentSettings, 'active', true)) { | |
| 540 | - $bitFormFrontArr['formSettings'] = (Object)[ | |
| 549 | + if (Helpers::property_exists_nested($formAbandonmentSettings, 'active', true)) { | |
| 550 | + $bitFormFrontArr['formSettings'] = (object)[ | |
| 541 | 551 | 'formAbandonment' => $formAbandonmentSettings |
| 542 | 552 | ]; |
| 543 | 553 | } |
| 544 | 554 | |
| @@ -678,9 +688,8 @@ | ||
| 678 | 688 | } |
| 679 | 689 | } |
| 680 | 690 | } |
| 681 | 691 | } |
| 682 | - | |
| 683 | 692 | return $fields; |
| 684 | 693 | } |
| 685 | 694 | |
| 686 | 695 | public function loadAssets($formID = 0, $fromType = 'classic') |