Skip to content

Commit 3a79beb

Browse files
committed
fix: contatore differenze in campi personalizzati
1 parent 4849fbf commit 3a79beb

1 file changed

Lines changed: 1 addition & 41 deletions

File tree

modules/aggiornamenti/edit.php

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ function highlightDifferences($current, $expected)
739739
$results_widgets = widgets_diff($data_widgets, $widgets);
740740
$results_widgets_added = widgets_diff($widgets, $data_widgets);
741741

742-
if (!empty($results) || !empty($results_added) || !empty($results_settings) || !empty($results_settings_added) || !empty($results_widgets) || !empty($results_widgets_added)) {
742+
if (!empty($results) || !empty($results_added)) {
743743
$database_has_errors = true;
744744

745745
// Conta i tipi di errori nei risultati (campi mancanti/modificati)
@@ -790,46 +790,6 @@ function highlightDifferences($current, $expected)
790790
}
791791
}
792792

793-
// Conta i tipi di errori nelle impostazioni
794-
foreach ($results_settings as $key => $setting) {
795-
if (!$setting['current']) {
796-
++$database_danger_count; // Impostazione mancante
797-
} else {
798-
++$database_warning_count; // Impostazione modificata
799-
}
800-
}
801-
802-
// Conta le impostazioni non previste
803-
foreach ($results_settings_added as $key => $setting) {
804-
if ($setting['current'] == null && !isset($premium_settings[$key])) {
805-
++$database_info_count; // Impostazione non prevista
806-
}
807-
}
808-
809-
// Conta i tipi di errori nei widgets
810-
foreach ($results_widgets as $module_key => $module_widgets) {
811-
if (is_array($module_widgets)) {
812-
foreach ($module_widgets as $widget_name => $widget) {
813-
if (!$widget['current']) {
814-
++$database_danger_count; // Widget mancante
815-
} else {
816-
++$database_warning_count; // Widget modificato
817-
}
818-
}
819-
}
820-
}
821-
822-
// Conta i widgets non previsti
823-
foreach ($results_widgets_added as $module_key => $module_widgets) {
824-
if (is_array($module_widgets)) {
825-
foreach ($module_widgets as $widget_name => $widget) {
826-
if ($widget['current'] == null) {
827-
++$database_info_count; // Widget non previsto
828-
}
829-
}
830-
}
831-
}
832-
833793
$database_error_count = $database_danger_count + $database_warning_count + $database_info_count + $database_premium_count;
834794
}
835795
}

0 commit comments

Comments
 (0)