Skip to content

Commit

Permalink
Merge pull request #876 from cjuergen/DS-2482
Browse files Browse the repository at this point in the history
Fix for DS-2482
  • Loading branch information
pnbecker committed Apr 8, 2015
2 parents f809f36 + 682c05b commit 8a5ecc0
Showing 1 changed file with 20 additions and 0 deletions.
Expand Up @@ -160,12 +160,32 @@ protected void doDSGet(Context context, HttpServletRequest request,
// and firing a usage event for the DSO we're reporting for
return;
} else if ("/browse".equals((extraPathInfo)) || StringUtils.startsWith(extraPathInfo, "/browse?")) {
// Add the location if we got a community or collection
if (dso instanceof Community)
{
Community c = (Community) dso;
request.setAttribute("dspace.community", c);
} else if (dso instanceof Collection)
{
Collection c = (Collection) dso;
request.setAttribute("dspace.collection", c);
}
request.getRequestDispatcher(extraPathInfo).forward(request, response);
// If we don't return here, we keep processing and end up
// throwing a NPE when checking community authorization
// and firing a usage event for the DSO we're reporting for
return;
} else if ("/simple-search".equals(extraPathInfo) || StringUtils.startsWith(extraPathInfo, "simple-search?")) {
// Add the location if we got a community or collection
if (dso instanceof Community)
{
Community c = (Community) dso;
request.setAttribute("dspace.community", c);
} else if (dso instanceof Collection)
{
Collection c = (Collection) dso;
request.setAttribute("dspace.collection", c);
}
request.getRequestDispatcher(extraPathInfo).forward(request, response);
// If we don't return here, we keep processing and end up
// throwing a NPE when checking community authorization
Expand Down

0 comments on commit 8a5ecc0

Please sign in to comment.