When opening a top level schematic that has sub schematics, EEschema tries to open all underlying sub level schematics. That’s fine.
But when something goes wrong in opening the sub level schematics, it generates an error message and fails to open the top level schematic. Instead, it presents a new, empty schematic.
As a consequence, once you loose a sub schematic, you loose everything that is in the top level too. This is a bit harsh.
I would like to propose that, whenever loading a sub schematic fails, the top level still opens, so that you can at least save whatever is in the top level and possibly correct pathnames etc.
If you would like to reproduce the behaviour, try the following:
Create a project and a top level schematic.
Create two different sub level schematics.
Now save and quit kiCAD
Remove one of the SUB schematics from your disk.
Reopen the top level schematic in KiCAD. It now fails to open the TOP level schematic.
I know the .sch is not lost and I know how to repair the situation from backup. My suggestion is to change the way in which EEschema handles the error situation to be a little more friendly to the user.
OK, I see.
I think this issue showed up in this forum months ago. It had a workaround: create again a new file in your disk with the same name as the one removed, open the project and delete the sheet from inside the schematic.
i can’t test it right now anyway.
My nightly from February under Windows doesn’t crap out on that problem.
Just copied a project into a new project folder and removed some sub-sheets and EEschema told me that those sheets aren’t available like this:
But after hitting OK it loaded the top level sheet just fine.
This is probably related, albeit not exactly the same, to bug reports #1683921 and #1689763.
If the older versions are behaving differently, it is probably regression.