linz / gazetteer

New Zealand Gazetteer of official place names
http://www.linz.govt.nz/regulatory/place-names/find-name/new-zealand-gazetteer-official-geographic-names/new-zealand-gazetteer-search-place-names#zoom=0&lat=-41.14127&lon=172.5&layers=BTTT
Other
2 stars 2 forks source link

Name tabs self destruct when using feature/name association links #213

Closed CMKMS-LINZ closed 3 years ago

CMKMS-LINZ commented 4 years ago

Bug Description

After creating a name or feature association between two names (per step 67 onwards in test plan 1), then clicking on the new link to the other name, it will switch to the associated name, but the panel for the name you were in will self-destruct with an error message.

Steps to Reproduce

1): Have two names open which have a Feature/Name association created 2): On which ever name you're looking at, click on the link to the other associated name. 3): it will correctly switch over to the associated name 4): click back on the tab for the 1st name 5): See error message

Desktop

Screenshots

image

SPlanzer commented 4 years ago

Bug triage for QGIS3 initial release

Porting has introduced this bug

Next steps

Investigate root cause and fix ready for 2.0.2 release

SPlanzer commented 3 years ago

when viewing the QWebFrame's url there is an evident state change before and after failure.

from the below debug code when the name tab has not "self destructed" qweb_frame.url() = 'file:///home/splanzer/.local/share/QGIS/QGIS3/profiles/default/python/plugins/NZGBplugin/LINZ/gazetteer/gui/html/'

and after

qweb_frame.url() = 'file:///home/splanzer/.local/share/QGIS/QGIS3/profiles/default/python/plugins/NZGBplugin/LINZ/gazetteer/gui/html/?id=57558'

not after failure the url includes ?id=<name_id>

from qgis.utils import plugins, iface, reloadPlugin
gazetteer_plugin = plugins.get("NZGBplugin")
controller = gazetteer_plugin._controller

views = controller.getNameViews()
qweb_dock_1 = views[1] #NameWebDock
qweb_view_1 = qweb_dock_1._nameWidget  #QWebView
qweb_page_1 = qweb_view_1.page() #QWebPage
qweb_frame = qweb_page_1.mainFrame()
print(qweb_frame.url())

The appending of the query parameter is somewhat expected as this is triggered from a href in the html template.

HOWEVER Testing in QGIS2 where this is not an issue shows the QWebFrame does not ended up with a url that includes the the query parameter after clicking the href for "Feature/Name associations"

it would appears this inclusion of the href that modifies the webframe url after clocking the "Feature/Name associations" href breaks the webpage

QT5 change doc

states -QUrl changed considerably in Qt 5 to comply better with the URL specifications and with brokenness out there. The following list summarizes the most important functional changes: