-
Notifications
You must be signed in to change notification settings - Fork 7
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
GetFeatureInfo method returns different output on the same request #82
Comments
Hi @Gustry, were you able to reproduce this behavior? I'm asking because I've seen some commits involving that part of code. If, hypothetically, this happened in js code, I would say that the problem is related to some asynchronous method, which I imagine is not the case for py. Thanks |
Hi, |
Hi @Gustry! I've made some progress. During execution the
is never reached because I've placed some logs inside the if relation:
LOGGER.warning(f"referenced Layer {relation.referencedLayer()} ============")
LOGGER.warning(f"referenced Layer Id {relation.referencedLayerId()} ============")
LOGGER.warning(f"relation name {relation.name()} ============")
LOGGER.warning(f"relation type {relation.type()} ============")
LOGGER.warning(f"is valid {relation.isValid()} ============")
LOGGER.warning(f"error? {relation.validationError()}")
a += Tooltip._generate_attribute_editor_relation(
node.label(), relation.id(), relation.referencingLayerId())
else: and result is: referenced Layer None ============
referenced Layer Id ============
relation name ============
relation type 0 ============
is valid False ============
error? Referencing layer not set BUT if we use the if isinstance(node, QgsAttributeEditorRelation):
relation = relation_manager.relation("birds_spot_area_id_natural_ar_id")
#relation = node.relation()
if relation:
LOGGER.warning(f"referenced Layer {relation.referencedLayer()} ============")
LOGGER.warning(f"referenced Layer Id {relation.referencedLayerId()} ============")
LOGGER.warning(f"relation name {relation.name()} ============")
LOGGER.warning(f"relation type {relation.type()} ============")
LOGGER.warning(f"is valid {relation.isValid()} ============")
LOGGER.warning(f"error? {relation.validationError()}")
a += Tooltip._generate_attribute_editor_relation(
node.label(), relation.id(), relation.referencingLayerId())
else: the output seems OK and also the HTML on client: referenced Layer <QgsVectorLayer: 'natural_areas' (postgres)> ============
referenced Layer Id natural_areas_8babd542_8324_458a_adf6_91dd0d06fe4a ============
relation name nat_areas_birds_spots ============
relation type 0 ============
is valid True ============
error? I don't know if the Thanks! |
I remember this PR from my colleague @dmarteau and @rldhont qgis/QGIS#33476 |
@mind84 can check this : if isinstance(node, QgsAttributeEditorRelation):
node.init(relation_manager) # Initializes the relation from the id
relation = node.relation() |
Fixed in version 2.10.1 with 6a42400 |
Hi!
We're working on
Lizmap
to improve the display of the related children popup (e.g. display children in the corresponding tab, if any).We're facing a weird issue when the popup appears and this problem happens seemingly randomly.
To properly address the children to the correct tab, I'm using a
div
container added programmatically by the method Tooltip._generate_attribute_editor_relation, called when a relation is detected:qgis-lizmap-server-plugin/lizmap_server/tooltip.py
Line 142 in 84a2a6d
In this
div
, attributes likelayerId
orrelation name
are added asnode
attribute in order to have a suitable DOM reference to address popup children.Problem is that sometimes these attribute are filled in correctly and sometimes they are empty (even between two identical subsequent requests)
Here two output of the
GetFeatureInfo
request, first when attributes are filled and second with empty attriutes:We've done some debug on the plugin and seems that sometimes the method
node.relation()
qgis-lizmap-server-plugin/lizmap_server/tooltip.py
Line 143 in 84a2a6d
returns an
empty object
We cannot figure out what's going on since, as mentioned, the method acts differently on identical requests.
Simply load the following test project in a local
Lizmap
master branch:children_in_tabs.qgs.zip
Anyway, the basic system information of the stack used to reproduce the issue is as follows:
Versions :
List of safeguards :
Thanks!
@ghtmtt
The text was updated successfully, but these errors were encountered: