You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks easy now to have a broken configuration in Lizmap when we remove a layer from QGIS.
Maye the signel is not detected and the cleaning is not done
Versions, safeguards, checks summary etc
Git master branch
Check Lizmap plugin
I have done the step just before in the Lizmap QGIS desktop plugin before opening this ticket. Otherwise, my ticket is not considered valid and might get closed.
The text was updated successfully, but these errors were encountered:
Hi, I'd like to work on this issue. It seems that when a layer is removed, related tables might still reference it, potentially causing errors or unexpected behavior.
Could you clarify:
Should the system automatically clean up the tables, or should users be notified?
Are there specific database tables or code sections handling these layer relationships?
I’d be happy to investigate and suggest a fix. Let me know your thoughts!
We can use it if you suggest
SQL Check Before Removing a Layer
SELECT * FROM layer_table WHERE layer_id = 'LAYER_ID';
PHP: Remove References Before Deleting a Layer
function deleteLayer($layerId) {
// Remove references first
$db->query("DELETE FROM related_table WHERE layer_id = ?", [$layerId]);
// Now delete the layer
$db->query("DELETE FROM layers WHERE id = ?", [$layerId]);
}
JavaScript: Warn User Before Deleting a Layer
function confirmLayerDeletion(layerId) {
if (confirm("This layer is linked to other tables. Are you sure you want to remove it?")) {
deleteLayer(layerId);
}
}
What is the bug?
It looks easy now to have a broken configuration in Lizmap when we remove a layer from QGIS.
Maye the signel is not detected and the cleaning is not done
Versions, safeguards, checks summary etc
Git master branch
Check Lizmap plugin
The text was updated successfully, but these errors were encountered: