placing a non-empty hierarchical sheet with remote path results in strange warning
Description
When creating schematics and if you place a hierarchical sheet which points to a file which resides in a different folder, while choosing to refer with relative path and if schematics is non empty Kicad issues a warning dialog titled "Continue Load Schematics" with contents: "The project library table 'absolute path to location of sheet file\relative_1.kicad_sch' does not exist or cannot be read. This may result in broken symbol links for the schematics. Do you wish to continue?"
If you place this file in the project folder, you and reference it when placing a hierarchical sheet without this warning.
Steps to reproduce
- Unzip attached project
- Open project
- Open schematics
- Place new hierarchical sheet and reference an existing file from project folder.
- KiCad ask you how you want it to refer to the file (with absolute or relative path?) Choose relative
- KiCad ask for confirmation to link to this file. Choose yes
- Sheet is placed without any additional dialogs
- Place new hierarchical sheet and reference an existing file from relative_path folder (../relative_path/relative_2.kicad_sch).
- KiCad ask you how you want it to refer to the file (with absolute or relative path?) Choose relative
- KiCad ask for confirmation to link to this file. Choose yes
- KiCad displays aforementioned "Continue Load Schematics" dialog
- Choosing "Continue Load" results in properly built schematics. So this is not a critical bug.
EDIT: attaching a test project: test_project.zip
KiCad Version
Application: KiCad (64-bit)
Version: (6.0.2-159-g8f75841c85), release build
Libraries:
wxWidgets 3.1.5
libcurl/7.78.0-DEV Schannel zlib/1.2.11
Platform: Windows 10 (build 18363), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
Date: Mar 3 2022 22:09:58
wxWidgets: 3.1.5 (wchar_t,wx containers)
Boost: 1.76.0
OCC: 7.6.0
Curl: 7.78.0-DEV
ngspice: 36
Compiler: Visual C++ 1928 without C++ ABI
Build settings:
KICAD_USE_OCC=ON
KICAD_SPICE=ON