Navigation Menu

Skip to content

Commit

Permalink
[FIXED JENKINS-23525]
Browse files Browse the repository at this point in the history
Crash when using Folders plugin:
com.cloudbees.hudson.plugins.folder.Folder cannot be cast to
hudson.model.Job
  • Loading branch information
tomaszbech committed Sep 18, 2015
1 parent 58c4893 commit 312109b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/main/java/maps/hudson/plugin/xfpanel/XFPanelView.java
Expand Up @@ -23,6 +23,8 @@

import javax.servlet.ServletException;

import jenkins.model.Jenkins;

import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
Expand Down Expand Up @@ -332,6 +334,13 @@ public Collection<XFPanelEntry> sort(Collection<Job<?, ?>> jobs) {
}
return Collections.emptyList();
}

public Collection<Job<?, ?>> getPrioritySortedJobs() {
List<Job<?, ?>> allItems = null;
allItems = Jenkins.getInstance().getAllItems((Class<Job<?,?>>) (Class) Job.class);
return getPrioritySortedJobs(allItems);
}

public Collection<Job<?, ?>> getPrioritySortedJobs(Collection<Job<?, ?>> jobs) {
return getPrioritySortedJobs(jobs, true);
}
Expand Down
Expand Up @@ -41,7 +41,6 @@
<ul class="checklist" id="allJobs">
<!-- Get a priority sorted list of jobs -->
<j:invoke method="getPrioritySortedJobs" var="prioJobs" on="${it}">
<j:arg type="java.util.Collection" value="${app.items}" />
</j:invoke>
<j:invoke method="getItems" var="allItems" on="${it}">
</j:invoke>
Expand Down
Expand Up @@ -6,7 +6,7 @@
xmlns:i="jelly:fmt">

<style type="text/css">
#side-panel, #page-head { display: none; visibility: hidden; height: 0px; }
#side-panel, #page-head, #main-panel-content h1 { display: none; visibility: hidden; height: 0px; }
</style>
<j:choose>
<j:when test="${empty(items)}">
Expand Down

0 comments on commit 312109b

Please sign in to comment.