Skip to content

Commit c672367

Browse files
authored
Merge pull request #5522 from Gustry/warnings-console
Console - Add the number of warnings
2 parents 7a47376 + 1713c03 commit c672367

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

assets/src/modules/ExecuteJSFromServer.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,9 @@ function displayWarningsAdministrator(withDisplay) {
164164
).attr('id', 'lizmap-warning-message');
165165
}
166166

167-
} else if (document.body.dataset.lizmapPluginHasWarnings) {
168-
console.warn('The project has some warnings in the Lizmap plugin.');
167+
} else if (document.body.dataset.lizmapPluginWarningsCount) {
168+
console.warn(
169+
`The project has ${document.body.dataset.lizmapPluginWarningsCount} warning(s) in the Lizmap plugin.`);
169170

170171
if (document.body.dataset.lizmapPluginHasWarningsUrl && withDisplay) {
171172
let messageHasWarnings = lizDict['project.has.warnings'];

lizmap/modules/view/controllers/lizMap.classic.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ function f($x)
545545
$rep->setBodyAttributes(array('data-lizmap-plugin-update-warning-url' => jUrl::get('admin~qgis_projects:index')));
546546
}
547547
} elseif ($lproj->projectCountCfgWarnings() >= 1) {
548-
$rep->setBodyAttributes(array('data-lizmap-plugin-has-warnings' => true));
548+
$rep->setBodyAttributes(array('data-lizmap-plugin-warnings-count' => $lproj->projectCountCfgWarnings()));
549549
if ($isAdmin) {
550550
$rep->setBodyAttributes(array('data-lizmap-plugin-has-warnings-url' => jUrl::get('admin~qgis_projects:index')));
551551
}

0 commit comments

Comments
 (0)