planetfederal / qgis-suite-plugin

GNU General Public License v2.0
25 stars 17 forks source link

QGIS OpenGeo Explorer: clean styles does not check layer groups #161

Closed tbarsballe closed 9 years ago

tbarsballe commented 9 years ago

From @tbarsballe on January 14, 2015 20:9

If you try to run "clean (remove unused styles)", with styles that are used only by layer groups, it will attempt to remove those styles, and fail with an error since the styles are being used.

(Tested on OS X 10.10, QGIS 2.6.1)

Copied from original issue: boundlessgeo/suite#842

tbarsballe commented 9 years ago

From @volaya on January 16, 2015 7:4

I don't understand this one. Groups do not use styles. A group is a set of layer, and each layer has its own styles. Even if it is in a group, a layer will always be in the "layers" entry, which contains them all, and it is that collection of layers that is used to determine if a style is being used or not.

Can you provide an error trace to have more detail about this error? Thanks!

tbarsballe commented 9 years ago

When you create a geoserver group in QGIS OpenGeo Explorer, you can assign different styles to the layers than their default. If you do so, and later try to clean the styles, you get the following error:

Tried to make a DELETE request to http://localhost:8080/geoserver/rest/styles/n.xml?purge=true but got a 500 status code: :Unable to delete style referenced by layer group 'Group' Traceback (most recent call last): File "/Users/tbarsballe/.qgis2/python/plugins/opengeo/gui/explorer.py", line 109, in run command(*params) File "/Users/tbarsballe/.qgis2/python/plugins/opengeo/qgis/catalog.py", line 76, in cleanUnusedStyles style.catalog.delete(style, purge = True) File "/Users/tbarsballe/.qgis2/python/plugins/opengeo/ext-libs/gsconfig-0.6.9-py2.7.egg/geoserver/catalog.py", line 161, in delete raise FailedRequestError("Tried to make a DELETE request to %s but got a %d status code: \n%s" % (rest_url, response.status, content)) FailedRequestError: Tried to make a DELETE request to http://localhost:8080/geoserver/rest/styles/n.xml?purge=true but got a 500 status code: :Unable to delete style referenced by layer group 'Group'