noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 13/46: Forecast : protect against empty name


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 13/46: Forecast : protect against empty name
Date: Tue, 13 Jul 2021 05:01:51 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 5e153bd44d7460ca1515fe44ff6717c83a73a278
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Thu Jun 10 16:42:54 2021 +0200

    Forecast : protect against empty name
---
 include/ajax/ajax_forecast.php | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/ajax/ajax_forecast.php b/include/ajax/ajax_forecast.php
index e048f3e..1e94320 100644
--- a/include/ajax/ajax_forecast.php
+++ b/include/ajax/ajax_forecast.php
@@ -54,7 +54,12 @@ if ($action == "ok") {
     $data_sql = new Forecast_SQL($cn, $f_id);
     switch ($input->name) {
         case 'f_name':
-            $data_sql->setp($input->name, $value);
+            if ( trim($value)!="") {
+                $data_sql->setp($input->name, $value);
+            } else {
+                $value=$data_sql->getp('f_name');
+                  $ajax->set_value($value);
+            }
             break;
         case 'p_start':
             $data_sql->setp("f_start_date", $value);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]