ROGUE-JCTD / rogue_geonode

GeoSHAPE - A Django package that adds GeoSHAPE functionality to GeoNode.
http://www.geoshape.org
GNU General Public License v3.0
12 stars 25 forks source link

Removing Layers through GeoNode removes additional layers. #7

Closed kelseyishmael closed 11 years ago

kelseyishmael commented 11 years ago

I have had it twice now where I went to remove layers from GeoNode and had it remove extra layers that were not selected for removal. Additionally it also removes the sld's associated with the layer's that were removed. Unfortunately I haven't had enough time to fully investigate this issue, so it needs more testing.

kelseyishmael commented 11 years ago

After further testing it would appear as though when you remove a layer through geonode it removes all layers with the same geometry type as the one you remove. So if you delete a point layer it will remove any layers published in geonode that are point layers.

garnertb commented 11 years ago

Here is a log with the behavior.

[08/Aug/2013 15:23:47] "GET /layers/geonode:Mines_HO/remove HTTP/1.0" 200 9324
[08/Aug/2013 15:23:47] "GET /jsi18n/ HTTP/1.0" 200 2351
[08/Aug/2013 15:23:47] "GET /lang.js HTTP/1.0" 200 10016
DEBUG 2013-08-08 15:23:48,435 views layer_remove 4648 139844912060160 geonode:Mines_HO Layer
DEBUG 2013-08-08 15:23:48,659 helpers cascading_delete 4648 139844912060160 Running GeoGit delete logic.
DEBUG 2013-08-08 15:23:48,659 models pre_delete_layer 4648 139844912060160 Going to delete the styles associated for [geonode:Mines_HO]
DEBUG 2013-08-08 15:23:48,677 models post_delete_layer 4648 139844912060160 Going to delete associated maplayers for [geonode:Mines_HO]
DEBUG 2013-08-08 15:23:48,682 models post_delete_layer 4648 139844912060160 Going to delete the default style for [geonode:Mines_HO]
DEBUG 2013-08-08 15:23:48,863 helpers cascading_delete 4648 139844912060160 Running GeoGit delete logic.
DEBUG 2013-08-08 15:23:48,863 models pre_delete_layer 4648 139844912060160 Going to delete the styles associated for [geonode:Bridges_HO]
DEBUG 2013-08-08 15:23:49,044 helpers cascading_delete 4648 139844912060160 Running GeoGit delete logic.
DEBUG 2013-08-08 15:23:49,044 models pre_delete_layer 4648 139844912060160 Going to delete the styles associated for [geonode:FoodSecurity_HO]
DEBUG 2013-08-08 15:23:49,057 models post_delete_layer 4648 139844912060160 Going to delete associated maplayers for [geonode:FoodSecurity_HO]
DEBUG 2013-08-08 15:23:49,061 models post_delete_layer 4648 139844912060160 Going to delete the default style for [geonode:FoodSecurity_HO]
DEBUG 2013-08-08 15:23:49,075 models post_delete_layer 4648 139844912060160 Going to delete associated maplayers for [geonode:Bridges_HO]
DEBUG 2013-08-08 15:23:49,078 models post_delete_layer 4648 139844912060160 Going to delete the default style for [geonode:Bridges_HO]
[08/Aug/2013 15:23:49] "POST /layers/geonode:Mines_HO/remove HTTP/1.0" 302 0
DEBUG 2013-08-08 15:23:49,153 views _search 4648 139844912060160 cached search results 13455
DEBUG 2013-08-08 15:23:49,154 views search_api 4648 139844912060160 generated combined search results in 0.0311250686646, 9.53674316406e-07
DEBUG 2013-08-08 15:23:49,154 views search_api 4648 139844912060160 with 6 db queries
[08/Aug/2013 15:23:49] "GET /layers/ HTTP/1.0" 200 32771
jj0hns0n commented 11 years ago

@garnertb can you verify this behavior exists on a normal geonode install. I've never seen this kind of thing before and wonder if it somehow has to do with GeoGit stores or something else unique to ROGUE. If you dont find it in normal GeoNode, lets look at it together in a ROGUE build and see if we can figure out whats going on. This is really bizzare behavior.

On Thu, Aug 8, 2013 at 1:44 PM, Tyler Garner notifications@github.comwrote:

Here is a log with the behavior.

[08/Aug/2013 15:23:47] "GET /layers/geonode:Mines_HO/remove HTTP/1.0" 200 9324 [08/Aug/2013 15:23:47] "GET /jsi18n/ HTTP/1.0" 200 2351 [08/Aug/2013 15:23:47] "GET /lang.js HTTP/1.0" 200 10016 DEBUG 2013-08-08 15:23:48,435 views layer_remove 4648 139844912060160 geonode:Mines_HO Layer DEBUG 2013-08-08 15:23:48,659 helpers cascading_delete 4648 139844912060160 Running GeoGit delete logic. DEBUG 2013-08-08 15:23:48,659 models pre_delete_layer 4648 139844912060160 Going to delete the styles associated for [geonode:Mines_HO] DEBUG 2013-08-08 15:23:48,677 models post_delete_layer 4648 139844912060160 Going to delete associated maplayers for [geonode:Mines_HO] DEBUG 2013-08-08 15:23:48,682 models post_delete_layer 4648 139844912060160 Going to delete the default style for [geonode:Mines_HO] DEBUG 2013-08-08 15:23:48,863 helpers cascading_delete 4648 139844912060160 Running GeoGit delete logic. DEBUG 2013-08-08 15:23:48,863 models pre_delete_layer 4648 139844912060160 Going to delete the styles associated for [geonode:Bridges_HO] DEBUG 2013-08-08 15:23:49,044 helpers cascading_delete 4648 139844912060160 Running GeoGit delete logic. DEBUG 2013-08-08 15:23:49,044 models pre_delete_layer 4648 139844912060160 Going to delete the styles associated for [geonode:FoodSecurity_HO] DEBUG 2013-08-08 15:23:49,057 models post_delete_layer 4648 139844912060160 Going to delete associated maplayers for [geonode:FoodSecurity_HO] DEBUG 2013-08-08 15:23:49,061 models post_delete_layer 4648 139844912060160 Going to delete the default style for [geonode:FoodSecurity_HO] DEBUG 2013-08-08 15:23:49,075 models post_delete_layer 4648 139844912060160 Going to delete associated maplayers for [geonode:Bridges_HO] DEBUG 2013-08-08 15:23:49,078 models post_delete_layer 4648 139844912060160 Going to delete the default style for [geonode:Bridges_HO] [08/Aug/2013 15:23:49] "POST /layers/geonode:Mines_HO/remove HTTP/1.0" 302 0 DEBUG 2013-08-08 15:23:49,153 views _search 4648 139844912060160 cached search results 13455 DEBUG 2013-08-08 15:23:49,154 views search_api 4648 139844912060160 generated combined search results in 0.0311250686646, 9.53674316406e-07 DEBUG 2013-08-08 15:23:49,154 views search_api 4648 139844912060160 with 6 db queries [08/Aug/2013 15:23:49] "GET /layers/ HTTP/1.0" 200 32771

— Reply to this email directly or view it on GitHubhttps://github.com/ROGUE-JCTD/rogue_geonode/issues/7#issuecomment-22354096 .

jj0hns0n commented 11 years ago

This output "Running GeoGit delete logic." is curious too, where does that come from?

On Thu, Aug 8, 2013 at 2:11 PM, Jeffrey Johnson jjohnson@opengeo.orgwrote:

@garnertb can you verify this behavior exists on a normal geonode install. I've never seen this kind of thing before and wonder if it somehow has to do with GeoGit stores or something else unique to ROGUE. If you dont find it in normal GeoNode, lets look at it together in a ROGUE build and see if we can figure out whats going on. This is really bizzare behavior.

On Thu, Aug 8, 2013 at 1:44 PM, Tyler Garner notifications@github.comwrote:

Here is a log with the behavior.

[08/Aug/2013 15:23:47] "GET /layers/geonode:Mines_HO/remove HTTP/1.0" 200 9324 [08/Aug/2013 15:23:47] "GET /jsi18n/ HTTP/1.0" 200 2351 [08/Aug/2013 15:23:47] "GET /lang.js HTTP/1.0" 200 10016 DEBUG 2013-08-08 15:23:48,435 views layer_remove 4648 139844912060160 geonode:Mines_HO Layer DEBUG 2013-08-08 15:23:48,659 helpers cascading_delete 4648 139844912060160 Running GeoGit delete logic. DEBUG 2013-08-08 15:23:48,659 models pre_delete_layer 4648 139844912060160 Going to delete the styles associated for [geonode:Mines_HO] DEBUG 2013-08-08 15:23:48,677 models post_delete_layer 4648 139844912060160 Going to delete associated maplayers for [geonode:Mines_HO] DEBUG 2013-08-08 15:23:48,682 models post_delete_layer 4648 139844912060160 Going to delete the default style for [geonode:Mines_HO] DEBUG 2013-08-08 15:23:48,863 helpers cascading_delete 4648 139844912060160 Running GeoGit delete logic. DEBUG 2013-08-08 15:23:48,863 models pre_delete_layer 4648 139844912060160 Going to delete the styles associated for [geonode:Bridges_HO] DEBUG 2013-08-08 15:23:49,044 helpers cascading_delete 4648 139844912060160 Running GeoGit delete logic. DEBUG 2013-08-08 15:23:49,044 models pre_delete_layer 4648 139844912060160 Going to delete the styles associated for [geonode:FoodSecurity_HO] DEBUG 2013-08-08 15:23:49,057 models post_delete_layer 4648 139844912060160 Going to delete associated maplayers for [geonode:FoodSecurity_HO] DEBUG 2013-08-08 15:23:49,061 models post_delete_layer 4648 139844912060160 Going to delete the default style for [geonode:FoodSecurity_HO] DEBUG 2013-08-08 15:23:49,075 models post_delete_layer 4648 139844912060160 Going to delete associated maplayers for [geonode:Bridges_HO] DEBUG 2013-08-08 15:23:49,078 models post_delete_layer 4648 139844912060160 Going to delete the default style for [geonode:Bridges_HO] [08/Aug/2013 15:23:49] "POST /layers/geonode:Mines_HO/remove HTTP/1.0" 302 0 DEBUG 2013-08-08 15:23:49,153 views _search 4648 139844912060160 cached search results 13455 DEBUG 2013-08-08 15:23:49,154 views search_api 4648 139844912060160 generated combined search results in 0.0311250686646, 9.53674316406e-07 DEBUG 2013-08-08 15:23:49,154 views search_api 4648 139844912060160 with 6 db queries [08/Aug/2013 15:23:49] "GET /layers/ HTTP/1.0" 200 32771

— Reply to this email directly or view it on GitHubhttps://github.com/ROGUE-JCTD/rogue_geonode/issues/7#issuecomment-22354096 .

garnertb commented 11 years ago

@jj0hns0n, will do.

I've narrowed it down to the instance.default_style.delete() call in the post_delete_layer function in layers/models.py. We've noticed this on GeoGit layers that have been imported via the updatelayers management command so something in the gs_slurp function could be causing this as well.

The "Running GeoGit delete logic." was a message I added when I was trying to hunt this down. I thought cascading_delete potentially needed custom delete logic for geogit similar to the postgis function.

garnertb commented 11 years ago

Fixed, merged in upstream geonode: https://github.com/GeoNode/geonode/commit/7a493f50de177a2164c4cb6a560ad4f8c4035b8b