-
Bug
-
Resolution: Unresolved
-
Minor
-
None
// code placeholder
When using an optional block in jelly configuration files, if the checkbox is not checked in the UI, when sent in the Stapler request, sometimes translates to an empty JSON object some other times in a String.
Example: given the following optional block
<f:optionalBlock name="enable" title="${%Enable}" checked="${instance != null and instance.count != null}">
belonging to the java com.example.Property.java class, if it's not checked in the UI, the stapler request can either receive a JSON containing
"com.example.Property":{}}"
or
com-example-Property":{"enable":false}
When you submit the form, you will get an error like
JSONObject["someField"] is not a JSONObject
- is duplicated by
-
JENKINS-43184 JSONObject["useSecurity"] is not a JSONObject
-
- Open
-
-
JENKINS-43559 JSONObject["csrf"] is not a JSONObject
-
- Resolved
-
- links to
[JENKINS-43326] Optional block in jelly has inconsistent behaviour when translated to JSON
Issue Type | Original: Improvement [ 4 ] | New: Bug [ 1 ] |
Description |
Original:
Optional block in jelly configuration files, if it's not checked sometimes translates to an empty JSON object some other times in a String. Example: given the following optional block {noformat} <f:optionalBlock name="enable" title="${%Enable}" checked="${instance != null and instance.count != null}">{noformat} belonging to the java com.example.Property.java class, if it's not checked in the UI, the stapler request can either receive a JSON containing {noformat} "com.example.Property":{}}" {noformat} or {noformat} com-example-Property":{"enable":false}{noformat} I believe the behaviour should be consistent. |
New:
When using an optional block in jelly configuration files, if the checkbox is not checked in the UI, when sent in the Stepler request, sometimes translates to an empty JSON object some other times in a String. Example: given the following optional block {noformat} <f:optionalBlock name="enable" title="${%Enable}" checked="${instance != null and instance.count != null}">{noformat} belonging to the java com.example.Property.java class, if it's not checked in the UI, the stapler request can either receive a JSON containing {noformat} "com.example.Property":{}}" {noformat} or {noformat} com-example-Property":{"enable":false}{noformat} I believe the behaviour should be consistent. |
Description |
Original:
When using an optional block in jelly configuration files, if the checkbox is not checked in the UI, when sent in the Stepler request, sometimes translates to an empty JSON object some other times in a String. Example: given the following optional block {noformat} <f:optionalBlock name="enable" title="${%Enable}" checked="${instance != null and instance.count != null}">{noformat} belonging to the java com.example.Property.java class, if it's not checked in the UI, the stapler request can either receive a JSON containing {noformat} "com.example.Property":{}}" {noformat} or {noformat} com-example-Property":{"enable":false}{noformat} I believe the behaviour should be consistent. |
New:
When using an optional block in jelly configuration files, if the checkbox is not checked in the UI, when sent in the Stapler request, sometimes translates to an empty JSON object some other times in a String. Example: given the following optional block {noformat} <f:optionalBlock name="enable" title="${%Enable}" checked="${instance != null and instance.count != null}">{noformat} belonging to the java com.example.Property.java class, if it's not checked in the UI, the stapler request can either receive a JSON containing {noformat} "com.example.Property":{}}" {noformat} or {noformat} com-example-Property":{"enable":false}{noformat} I believe the behaviour should be consistent. |
Link | New: This issue is duplicated by JENKINS-43184 [ JENKINS-43184 ] |
Remote Link | New: This issue links to "jenkins#2858 PR (Web Link)" [ 16303 ] |
Description |
Original:
When using an optional block in jelly configuration files, if the checkbox is not checked in the UI, when sent in the Stapler request, sometimes translates to an empty JSON object some other times in a String. Example: given the following optional block {noformat} <f:optionalBlock name="enable" title="${%Enable}" checked="${instance != null and instance.count != null}">{noformat} belonging to the java com.example.Property.java class, if it's not checked in the UI, the stapler request can either receive a JSON containing {noformat} "com.example.Property":{}}" {noformat} or {noformat} com-example-Property":{"enable":false}{noformat} I believe the behaviour should be consistent. |
New:
When using an optional block in jelly configuration files, if the checkbox is not checked in the UI, when sent in the Stapler request, sometimes translates to an empty JSON object some other times in a String. Example: given the following optional block {noformat} <f:optionalBlock name="enable" title="${%Enable}" checked="${instance != null and instance.count != null}">{noformat} belonging to the java com.example.Property.java class, if it's not checked in the UI, the stapler request can either receive a JSON containing {noformat} "com.example.Property":{}}" {noformat} or {noformat} com-example-Property":{"enable":false}{noformat} I believe the behaviour should be consistent. |
Description |
Original:
When using an optional block in jelly configuration files, if the checkbox is not checked in the UI, when sent in the Stapler request, sometimes translates to an empty JSON object some other times in a String. Example: given the following optional block {noformat} <f:optionalBlock name="enable" title="${%Enable}" checked="${instance != null and instance.count != null}">{noformat} belonging to the java com.example.Property.java class, if it's not checked in the UI, the stapler request can either receive a JSON containing {noformat} "com.example.Property":{}}" {noformat} or {noformat} com-example-Property":{"enable":false}{noformat} I believe the behaviour should be consistent. |
New:
{code:java} // code placeholder {code} When using an optional block in jelly configuration files, if the checkbox is not checked in the UI, when sent in the Stapler request, sometimes translates to an empty JSON object some other times in a String. Example: given the following optional block {noformat} <f:optionalBlock name="enable" title="${%Enable}" checked="${instance != null and instance.count != null}">{noformat} belonging to the java com.example.Property.java class, if it's not checked in the UI, the stapler request can either receive a JSON containing {noformat} "com.example.Property":{}}" {noformat} or {noformat} com-example-Property":{"enable":false}{noformat} When you submit the form, you will get an error like {noformat}JSONObject["someField"] is not a JSONObject{noformat} |
Link |
New:
This issue is duplicated by |
Remote Link | New: This issue links to "CloudBees Internal OSS-2150 (Web Link)" [ 18402 ] |