@@ -203,11 +203,22 @@ function highlightDifferences($current, $expected) {
203203 $ custom_views_not_standard = function_exists ('customViewsNotStandard ' ) ? customViewsNotStandard () : [];
204204 $ custom_modules_not_standard = function_exists ('customModulesNotStandard ' ) ? customModulesNotStandard () : [];
205205
206+ // Verifica se mancano i file di riferimento per viste e moduli
207+ $ views_file_missing = !empty ($ custom_views_not_standard )
208+ && count ($ custom_views_not_standard ) === 1
209+ && isset ($ custom_views_not_standard [0 ]['reason ' ])
210+ && $ custom_views_not_standard [0 ]['reason ' ] === 'File views.json assente ' ;
211+
212+ $ modules_file_missing = !empty ($ custom_modules_not_standard )
213+ && count ($ custom_modules_not_standard ) === 1
214+ && isset ($ custom_modules_not_standard [0 ]['reason ' ])
215+ && $ custom_modules_not_standard [0 ]['reason ' ] === 'File modules.json assente ' ;
216+
206217 // Determina se ci sono errori per ogni sezione
207218 $ has_file_errors = !empty ($ custom_files );
208219 $ has_table_errors = !empty ($ tables );
209- $ has_view_errors = !empty ($ custom_views_not_standard );
210- $ has_module_errors = !empty ($ custom_modules_not_standard );
220+ $ has_view_errors = !empty ($ custom_views_not_standard ) || $ views_file_missing ;
221+ $ has_module_errors = !empty ($ custom_modules_not_standard ) || $ modules_file_missing ;
211222 $ has_field_errors = !empty ($ custom_fields );
212223 $ has_any_errors = !empty ($ custom ) || $ has_file_errors || $ has_table_errors || $ has_view_errors || $ has_module_errors || $ has_field_errors ;
213224
@@ -341,8 +352,9 @@ function highlightDifferences($current, $expected) {
341352 </div> ' ;
342353
343354 // Card Viste
355+ $ has_view_data_issues = !empty ($ custom_views_not_standard ) && !$ views_file_missing ;
344356 $ view_icon = $ has_view_errors ? 'fa-exclamation-circle ' : 'fa-check-circle ' ;
345- $ view_count = $ has_view_errors ? count ($ custom_views_not_standard ) : 0 ;
357+ $ view_count = $ has_view_data_issues ? count ($ custom_views_not_standard ) : 0 ;
346358 $ view_expand_icon = $ has_view_errors ? 'fa-minus ' : 'fa-plus ' ;
347359
348360 echo '
@@ -361,7 +373,7 @@ function highlightDifferences($current, $expected) {
361373 </div>
362374 <div class="card-body"> ' ;
363375
364- if ($ has_view_errors ) {
376+ if ($ has_view_data_issues ) {
365377 echo '
366378 <div class="table-responsive">
367379 <table class="table table-hover table-striped table-sm">
@@ -441,6 +453,13 @@ function highlightDifferences($current, $expected) {
441453 </tbody>
442454 </table>
443455 </div> ' ;
456+ } elseif ($ views_file_missing ) {
457+ echo '
458+ <div class="alert alert-warning alert-database">
459+ <i class="fa fa-warning"></i> ' .tr ('Impossibile effettuare il controllo delle viste in assenza del file _FILE_ ' , [
460+ '_FILE_ ' => '<b>views.json</b> ' ,
461+ ]).'.
462+ </div> ' ;
444463 } else {
445464 echo '
446465 <p class="text-success mb-0">
@@ -453,8 +472,9 @@ function highlightDifferences($current, $expected) {
453472 </div> ' ;
454473
455474 // Card Moduli
475+ $ has_module_data_issues = !empty ($ custom_modules_not_standard ) && !$ modules_file_missing ;
456476 $ module_icon = $ has_module_errors ? 'fa-exclamation-circle ' : 'fa-check-circle ' ;
457- $ module_count = $ has_module_errors ? count ($ custom_modules_not_standard ) : 0 ;
477+ $ module_count = $ has_module_data_issues ? count ($ custom_modules_not_standard ) : 0 ;
458478 $ module_expand_icon = $ has_module_errors ? 'fa-minus ' : 'fa-plus ' ;
459479
460480 echo '
@@ -473,7 +493,7 @@ function highlightDifferences($current, $expected) {
473493 </div>
474494 <div class="card-body"> ' ;
475495
476- if ($ has_module_errors ) {
496+ if ($ has_module_data_issues ) {
477497 echo '
478498 <div class="table-responsive">
479499 <table class="table table-hover table-striped table-sm">
@@ -546,6 +566,13 @@ function highlightDifferences($current, $expected) {
546566 </tbody>
547567 </table>
548568 </div> ' ;
569+ } elseif ($ modules_file_missing ) {
570+ echo '
571+ <div class="alert alert-warning alert-database">
572+ <i class="fa fa-warning"></i> ' .tr ('Impossibile effettuare il controllo dei moduli in assenza del file _FILE_ ' , [
573+ '_FILE_ ' => '<b>modules.json</b> ' ,
574+ ]).'.
575+ </div> ' ;
549576 } else {
550577 echo '
551578 <p class="text-success mb-0">
0 commit comments