Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting Edge layer from a geopackage makes it impossible to open in QGIS anymore #1684

Open
deltamarnix opened this issue Aug 2, 2024 · 1 comment
Labels
bug Indicates an unexpected problem or unintended behavior QGIS Ribasim QGIS plugin

Comments

@deltamarnix
Copy link
Contributor

  • Open QGIS and ensure that the Ribasim plugin is installed and enabled.
  • Open the application via the Ribasim button on the QGIS toolbar: Ribasim panel opens.
  • Press the "New" button in the Model tab: file navigation window pops up.
  • Fill in a name ("test1").
  • Press OK: A toml and database file are created on the given location.
  • Press the "Edge" layer in the Model tab, press "Remove from Dataset": Popup shows "Deleting: Edge".
  • Press "Yes": "Edge" layer is removed from Layers panel and from Model tab.
  • Press the "Open" button in the Model tab: file navigation window pops up.
  • Open "test1.toml": Throws error, because it cannot find "Edge anymore".

Expected: Not such a big crash, but more like a validation error. Or we should not allow deletion of "Edge" and "Node" layers from the database.

@deltamarnix deltamarnix added QGIS Ribasim QGIS plugin bug Indicates an unexpected problem or unintended behavior labels Aug 2, 2024
@Huite
Copy link
Contributor

Huite commented Aug 2, 2024

Indeed, it shouldn't be possible to delete the Node and Edge layers.

In QGIS-Tim, I have two mandatory layers as well, they are always removed from the deletion selection:

        # Collect the selected items
        selection = self.selectedItems()
        selection = [
            item
            for item in selection
            if not isinstance(item.element, (Aquifer, Domain))
        ]

This is currently silent though, you probably want a an info message that mentions that these layers cannot be deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior QGIS Ribasim QGIS plugin
Projects
Status: To do
Development

No branches or pull requests

2 participants