Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[JENKINS-26781] lookup descriptor by ID, then by class if explicitly set
to match some specific use cases.
- Loading branch information
|
@@ -909,14 +909,19 @@ private URL getStaticHelpUrl(Klass<?> c, String suffix) { |
|
|
if (formData!=null) { |
|
|
for (Object o : JSONArray.fromObject(formData)) { |
|
|
JSONObject jo = (JSONObject)o; |
|
|
String kind = jo.optString("$class", null); |
|
|
if (kind == null) { |
|
|
// Legacy: Remove once plugins have been staged onto $class |
|
|
kind = jo.getString("kind"); |
|
|
Descriptor<T> d = null; |
|
|
String kind = jo.optString("kind", null); |
|
|
if (kind != null) { |
|
|
d = find(descriptors, kind); |
|
|
} |
|
|
if (d == null) { |
|
|
kind = jo.getString("$class"); |
|
|
d = find(descriptors, kind); |
|
|
} |
|
|
Descriptor<T> d = find(descriptors, kind); |
|
|
if (d != null) { |
|
|
items.add(d.newInstance(req, jo)); |
|
|
} else { |
|
|
LOGGER.warning("Received unexpected formData for descriptor " + kind); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
@@ -36,12 +36,11 @@ THE SOFTWARE. |
|
|
</st:documentation> |
|
|
<j:set var="clazz" value="${attrs.clazz ?: attrs.descriptor.clazz.name}" /> |
|
|
<f:invisibleEntry> |
|
|
<!-- Legacy: Remove once plugins have been staged onto $class --> |
|
|
<input type="hidden" name="stapler-class" value="${clazz}" /> |
|
|
<!-- Legacy: Remove once plugins have been staged onto $class --> |
|
|
<j:if test="${attrs.descriptor != null}"> |
|
|
<input type="hidden" name="kind" value="${attrs.descriptor.id}" /> |
|
|
</j:if> |
|
|
<!-- Legacy: Remove once plugins have been staged onto $class --> |
|
|
<input type="hidden" name="stapler-class" value="${clazz}" /> |
|
|
<input type="hidden" name="$class" value="${clazz}" /> |
|
|
</f:invisibleEntry> |
|
|
</j:jelly>
|
|
|
</j:jelly> |