Shipping note/rework
This commit is contained in:
@@ -29,6 +29,10 @@ class TTCrudBaseModel {
|
||||
|
||||
if (is_array($value)) {
|
||||
$value = json_encode($value);
|
||||
} else if ($value === "" && (new ReflectionProperty(get_called_class(), $field))->getType()->getName() === "float") {
|
||||
$value = null;
|
||||
} else if ($value === "" && (new ReflectionProperty(get_called_class(), $field))->getType()->getName() === "int") {
|
||||
$value = null;
|
||||
}
|
||||
|
||||
$sqlValues[] = $value === null ? 'NULL' : "'" . $db->real_escape_string($value) . "'";
|
||||
|
||||
@@ -370,4 +370,10 @@ class mfBaseController
|
||||
return $dbdate;
|
||||
}
|
||||
|
||||
public static function sendError(string $message): void {
|
||||
http_response_code(422); // More appropriate status for validation errors
|
||||
self::returnJson(['success' => false, 'message' => $message]);
|
||||
exit;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -118,6 +118,7 @@ class mfUpload_TmpFile {
|
||||
}
|
||||
|
||||
public function pdftotext() {
|
||||
if (!isset($cmd)) $cmd = "";
|
||||
$cmd .= PDFTOTEXT_BIN_PATH . " " . $this->tmp_name . " -";
|
||||
|
||||
$lines = [];
|
||||
|
||||
Reference in New Issue
Block a user