Skip to content

Commit

Permalink
Fixed issue with advanced file uploader
Browse files Browse the repository at this point in the history
  • Loading branch information
jaapjansma committed Sep 19, 2023
1 parent c843ffa commit 516702d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
5 changes: 4 additions & 1 deletion cf-civicrm-formprocessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: Integration of CiviCRM's Form Processor with Caldera Forms
* Description: This plugin integrates Caldera Forms with CiviCRM's form processor. Funded by CiviCooP, Civiservice.de, Bundesverband Soziokultur e.V., Article 19
* Version: 1.0.0
* Version: 1.0.1
* Author: Jaap Jansma
* Plugin URI: https://github.com/civimrf/cf-civicrm-formprocessor
* GitHub Plugin URI: civimrf/cf-civicrm-formprocessor
Expand Down Expand Up @@ -205,6 +205,9 @@ function cf_civicrm_formprocessor_log($message) {

if (Caldera_Forms_Field_Util::is_file_field($field, $form)) {
$value = $entry;
if (is_array($value)) {
$value = reset($value);
}
}
}
}
Expand Down
10 changes: 6 additions & 4 deletions processors/formprocessor/class-formprocessor-processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,16 +234,18 @@ protected function get_submitted_value( $config, $form ) {
$value = $config[ $field ];
}

$field_id_passed = strpos( $value, 'fld_' );
if ( false !== $field_id_passed ) {
$value = Caldera_Forms::get_field_data( $value, $form );
if (is_string($value)) {
$field_id_passed = strpos( $value, 'fld_' );
if (FALSE !== $field_id_passed) {
$value = Caldera_Forms::get_field_data( $value, $form );
}
}

}else{
$value = null;
}

if ( ! empty( $value ) ) {
if (!empty($value) && !is_array($value)) {
$value = call_user_func( $args['sanatize'], $value );
}

Expand Down
3 changes: 2 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: CiviCRM, form, contact form, forms
Requires at least: 5.2
Tested up to: 5.6
Requires PHP: 7.2
Stable tag: 1.0.0
Stable tag: 1.0.1
License: AGPL-3.0

This plugin integrates Caldera Forms with CiviCRM's form processor. Funded by CiviCooP, Civiservice.de, Bundesverband Soziokultur e.V., Article 19
Expand Down Expand Up @@ -57,4 +57,5 @@ NB - If you have not created any Form Processors, no CiviCRM Caldera Processors

== Changelog ==

1.0.1: Fixed issue with advanced file uploader
1.0.0: First version.

0 comments on commit 516702d

Please sign in to comment.