layer desactivated when we push a SLD file with REST API

Description

when we apply a SLD on a layer:
curl -u userass -XPUT -H 'Content-type: text/xml' -d '<layer><defaultStyle><name>roads_style</name></defaultStyle></layer>' http://localhost:8080/geoserver/rest/layers/my:roads - http://localhost:8080/geoserver/rest/layers/my:roads

It desactivate the layer and we have to do a :

curl -u userass -XPUT -H 'Content-type: text/xml' -d '<layer><defaultStyle><name>roads_style</name></defaultStyle><enabled>true</enabled></layer>' http://localhost:8080/geoserver/rest/layers/my:roads - http://localhost:8080/geoserver/rest/layers/my:roads
in order to re-activate the layer

But when we restart geoserver, the layer still desactivated

So, now, the only way is to activate the layer in the same request:
curl -u userass -XPUT -H 'Content-type: text/xml' -d '<layer><defaultStyle><name>roads_style</name></defaultStyle><enabled>true</enabled></layer>' http://localhost:8080/geoserver/rest/layers/my:roads - http://localhost:8080/geoserver/rest/layers/my:roads

Environment

None

Activity

Show:
codehaus
April 10, 2015, 3:49 PM

CodeHaus Comment From: tqh - Time: Mon, 28 Jun 2010 06:30:49 -0500
---------------------
<p>I can confirm this, in 2.X you need send &lt;enabled&gt;true&lt;/enabled&gt; which was not necessary in 1.7.7.</p>

codehaus
April 10, 2015, 3:49 PM

CodeHaus Comment From: nico4486 - Time: Mon, 28 Jun 2010 07:22:43 -0500
---------------------
<p>maybe a misunderstood</p>

<p>We have to push &lt;enabled&gt;true&lt;/enabled&gt; in the same request of</p>

<p> &lt;layer&gt;&lt;defaultStyle&gt;&lt;name&gt;roads_style&lt;/name&gt;&lt;/defaultStyle&gt;&lt;enabled&gt;true&lt;/enabled&gt;&lt;/layer&gt;</p>

<p>So, if we don't push both (enabling and styles) in the same request

and we push &lt;enabled&gt;true&lt;/enabled&gt; after the styles

when we reboot geoserver, the layer still desactivated.</p>

codehaus
April 10, 2015, 3:49 PM

CodeHaus Comment From: aaime - Time: Mon, 26 May 2014 08:48:01 -0500
---------------------
<p>According to a report from the mailing list, the issue does not show up in 2.5.1 anymore. Marking as solved</p>

Andrea Aime
February 15, 2017, 11:51 AM

Mass closing all resolved issues not modified in the last 4 weeks

Assignee

Unassigned

Reporter

codehaus

Triage

None

Fix versions

Affects versions

Components

Priority

Medium
Configure