Bug report #12060

WFS: missing fields when using GetFeature on a layer with a join

Added by Jeffrey Bostoen almost 10 years ago. Updated over 9 years ago.

Status:Closed
Priority:Normal
Assignee:Marco Hugentobler
Category:QGIS Server
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:20262

Description

Situation:
- shapefile layer with main data
- MySQL table (view)
- linked, caching enabled.

All works well so far.
But when I do a WFS-request, I only see the shapefile's attribute fields - not the ones I joined.

I checked permissions, and even tried checking select/insert/update/delete for just the table too.
I also checked the "Fields" tab of the shapefile - I see the fields listed, with WFS checked.

History

#1 Updated by Jeffrey Bostoen almost 10 years ago

Might be interesting to note: with that kind of setup, QGis Desktop fails to read the WFS-layer.

If you do the WFS-request with other software, sometimes you simply get no results, or just the original attributes.

#2 Updated by Giovanni Manghi almost 10 years ago

  • Status changed from Open to Feedback

Just to be sure, are we speaking about QGIS server here, right?

So the issue would be: if you do a join in a layer, then the same layer published (with qgis server) as WFS do not show the joined attributes, right? And also you are saying that the same layer with a join do not work at all if using QGIS as wfs client, right?

Does this happen with any type of layers and joined tables, or just specific formats?

#3 Updated by Giovanni Manghi almost 10 years ago

  • Category set to QGIS Server
  • Status changed from Feedback to Open
  • Affected QGIS version changed from 2.6.0 to master

Using QGIS as WFS client works for me for WFS layers with joined tables from QGIS server.

Anyway I confirm that the joined attributes show always empty.

This is on QGIS (server) master, not sure if it worked in previous qgis server releases, anyone that can check?

#4 Updated by Jeffrey Bostoen almost 10 years ago

We are indeed talking about QGis Server.

The MySQL is on another server. If I set up the service using QGis Desktop (that's where I also perform the "join", so I'm not reading the view directly from MySQL, the join is performed by QGis), the view works fine when I view it in the application.

I check the permissions, it seems fine for:
- the layer I joined to (shapefile)
- the individual fields listed (view created by QGis)
- I even added permissions in the WFS-matrix for the table (MySQL table)

But when I then open the WFS-service using QGis, the attributes do not show up. I don't know how this worked in previous versions.

#5 Updated by Giovanni Manghi almost 10 years ago

I don't know how this worked in previous versions.

this is the point, I already confirmed that joined attributes do not show in qgis server wfs layers regardless of the data type used. Now it is just a matter to confirm if it ever used to work in old releases.

#6 Updated by Jeffrey Bostoen almost 10 years ago

Perhaps it is because of issues when one would insert, update, delete a field which has been joined to the layer?
If that's the case, the WMS/WFS fields should be disabled in the [Fields] tab.

Although I feel it should still allow you to do a select though.

On the other hand: I'm greateful for this, but QGis does allow a WFS Service to access all the properties of features which originate from a MySQL View in the database itself (relying on this now!)

#7 Updated by René-Luc ReLuc almost 10 years ago

  • Target version set to Version 2.8
  • Assignee set to Marco Hugentobler

Does this issue is linked to #12090?
Does the commit 27bf440eace80c4f56c0f191706dfe1b046bcc96, Server: fix loading of dependent layers when using the getFeature() function?

#8 Updated by Giovanni Manghi over 9 years ago

  • Target version changed from Version 2.8 to Version 2.8.2

#9 Updated by Giovanni Manghi over 9 years ago

  • Target version changed from Version 2.8.2 to Version 2.10

#10 Updated by René-Luc ReLuc over 9 years ago

I thought this bug has been fixed in 2.8.2 with this commit 4f36b6572e71ed16f2071081f2f152c1d290b7cb cherry-picked from master eb5717d53916eb3f5886ddcee2a4111a3ac2dc9f

#11 Updated by Giovanni Manghi over 9 years ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed

it works fine in master. Thanks!

Also available in: Atom PDF