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

Missing XPath Crashes Project Load #41

Closed
philipbaileynar opened this issue Aug 20, 2021 · 3 comments
Closed

Missing XPath Crashes Project Load #41

philipbaileynar opened this issue Aug 20, 2021 · 3 comments
Assignees
Labels
🐛 bug Something isn't working 🌐 Viewer QGIS
Milestone

Comments

@philipbaileynar
Copy link
Contributor

The following VBET business logic error was causing the entire project to not load at all. Notice the empty xpath attribute:

 <Children>
    <Node label="Normalized Slope Evidence" xpath="Raster[@id='NORMALIZED_SLOPE']" type="raster" symbology="norm_slope" transparency="40" />
    <Node label="Normalized HAND Evidence" xpath="Raster[@id='NORMALIZED_HAND']" type="raster" symbology="norm_hand" transparency="40" />
    <Node label="Normalized TWI Evidence" xpath="Raster[@id='NORMALIZED_TWI']" type="raster" symbology="norm_twi" transparency="40" />
    <Node label="Normalized Channel Evidence" xpath="" type="raster" symbology="norm_channel" transparency="40" />
    <Node label="Combined Topographic Evidence" xpath="Raster[@id='EVIDENCE_TOPO']" type="raster" symbology="norm_topo" transparency="40" />
</Children>

QRAVE needs to be able to handle this more elegantly. Correct behaviour should be to raise a warning and continue loading, skipping the offending layer in question.

The error I was getting mentioned default_view, a complete red herring. Took me an hour to tediously comment out lines in the business logic until I found the problem!

@MattReimer
Copy link
Member

MattReimer commented Aug 21, 2021

Agreed that we should have an error for this. If the layer being referenced was part of a view (or worse a default view) that's probably why we were having the mislead and subsequent 🦆 chase.

@philipbaileynar if you still have it can you attach the entire project xml to this ticket or provide a link to the RS warehouse project? We want to make sure we can repro fully

@philipbaileynar
Copy link
Contributor Author

I don't think you need the project. It was a BL problem. But it is attached anyway.

@MattReimer
Copy link
Member

Thanks. We can also build checks for empty xpaths into the python validator. Might save us even having this problem again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🌐 Viewer QGIS
Projects
None yet
Development

No branches or pull requests

3 participants