Uploaded image for project: 'GeoServer'
  1. GeoServer
  2. GEOS-7857

Cascade Delete fails for a layer group contained within another layer group

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9.3, 2.10.1, 2.11-beta
    • Component/s: None
    • Labels:
      None

      Description

      If you try to apply a CascadeDeleteVisitor to a layer group that is itself contained within another layer group, you will get the following error:

      java.lang.IllegalArgumentException: Layer group has different number of styles than layers
      
      	at org.geoserver.catalog.impl.CatalogImpl.validate(CatalogImpl.java:845)
      	at org.geoserver.catalog.impl.CatalogImpl.save(CatalogImpl.java:938)
      	at org.geoserver.security.SecureCatalogImpl.save(SecureCatalogImpl.java:1315)
      	at org.geoserver.catalog.impl.AbstractFilteredCatalog.save(AbstractFilteredCatalog.java:740)
      	at org.geoserver.catalog.impl.AbstractCatalogDecorator.save(AbstractCatalogDecorator.java:446)
      	at org.geoserver.catalog.impl.LocalWorkspaceCatalog.save(LocalWorkspaceCatalog.java:218)
      	at org.geoserver.catalog.CascadeDeleteVisitor.visit(CascadeDeleteVisitor.java:273)
              ...
      

      Additionally, if you try to apply the CascadeDeleteVisitor to a store or workspace, when there is a global layer group containing only layers from that store/workspace and other layer groups containing such layers, the nested layer groups will not be removed properly, and you will wind up with empty layer groups that do not get automatically removed by the visitor.

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                tbarsballe Torben Barsballe
                Reporter:
                tbarsballe Torben Barsballe
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: