Skip to content

Commit 7562378

Browse files
committed
2.0.0
1 parent adc7f47 commit 7562378

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

API.class.php

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
class API
1111
{
1212
private static $version = "2.0.0";
13+
private static $releaseDate = "20180113";
1314
private static $systemErrors = array(304);
1415

1516
/**
@@ -33,6 +34,10 @@ public static function getVersion() {
3334
return self::$version;
3435
}
3536

37+
public static function getReleaseDate() {
38+
return self::$releaseDate;
39+
}
40+
3641
/**
3742
* This function lets you display the content generated from an export type into a webpage. You can
3843
* use this function on any export type in the database - even the ones that have been marked as "hidden". Note:
@@ -477,14 +482,29 @@ public function processFormSubmission($params)
477482
if (preg_match("/form_tools_delete_image_field__(.*)$/", $key, $matches)) {
478483
$file_field_to_delete = $matches[1];
479484
$is_deleting_file = true;
485+
$field_col = Fields::getFieldColByFieldName($form_id, $file_field_to_delete);
480486

481-
$field_id = Fields::getFormFieldIdByFieldName($file_field_to_delete, $form_id);
487+
try {
488+
$db->query("
489+
UPDATE {PREFIX}form_{$form_id}
490+
SET $field_col = :val
491+
WHERE submission_id = :submission_id
492+
");
493+
$db->bindAll(array(
494+
"val" => "",
495+
"submission_id" => $submission_id
496+
));
497+
$db->execute();
498+
499+
$path = $_SESSION[$namespace][$file_field_to_delete]["file_upload_dir"];
500+
$filename = $_SESSION[$namespace][$file_field_to_delete]["filename"];
501+
@unlink("$path/$filename");
482502

483-
// TOD.O ... field_type_file...
484-
//deleteFileSubmission($form_id, $submission_id, $field_id, true);
503+
unset($_SESSION[$namespace][$file_field_to_delete]);
504+
unset($params["form_data"][$key]);
505+
} catch (Exception $e) {
485506

486-
unset($_SESSION[$namespace][$file_field_to_delete]);
487-
unset($params["form_data"][$key]);
507+
}
488508
}
489509
}
490510

0 commit comments

Comments
 (0)