ソースを参照

When the toggle field and values are empty then use defaults

FusionPBX 2 年 前
コミット
c616e25332
1 ファイル変更9 行追加0 行削除
  1. 9 0
      resources/classes/database.php

+ 9 - 0
resources/classes/database.php

@@ -1983,6 +1983,15 @@
 						}
 						}
 					}
 					}
 
 
+					//if the toggle field and values are empty then set defaults
+					if (empty($toggle_field)) {
+						$toggle_field = self::singular($parent_name)."_enabled";
+					}
+					if (empty($toggle_values)) {
+						$toggle_values[] = 'true';
+						$toggle_values[] = 'false';
+					}
+
 					//get the current values from the database
 					//get the current values from the database
 					foreach ($toggle_array as $table_name => $table) {
 					foreach ($toggle_array as $table_name => $table) {
 						$x = 0;
 						$x = 0;