Skip to content

Commit

Permalink
Merge pull request #5522 from Gustry/warnings-console
Browse files Browse the repository at this point in the history
Console - Add the number of warnings
  • Loading branch information
Gustry authored Mar 6, 2025
2 parents 7a47376 + 1713c03 commit c672367
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions assets/src/modules/ExecuteJSFromServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,9 @@ function displayWarningsAdministrator(withDisplay) {
).attr('id', 'lizmap-warning-message');
}

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

if (document.body.dataset.lizmapPluginHasWarningsUrl && withDisplay) {
let messageHasWarnings = lizDict['project.has.warnings'];
Expand Down
2 changes: 1 addition & 1 deletion lizmap/modules/view/controllers/lizMap.classic.php
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ function f($x)
$rep->setBodyAttributes(array('data-lizmap-plugin-update-warning-url' => jUrl::get('admin~qgis_projects:index')));
}
} elseif ($lproj->projectCountCfgWarnings() >= 1) {
$rep->setBodyAttributes(array('data-lizmap-plugin-has-warnings' => true));
$rep->setBodyAttributes(array('data-lizmap-plugin-warnings-count' => $lproj->projectCountCfgWarnings()));
if ($isAdmin) {
$rep->setBodyAttributes(array('data-lizmap-plugin-has-warnings-url' => jUrl::get('admin~qgis_projects:index')));
}
Expand Down

0 comments on commit c672367

Please sign in to comment.