[dspace-tickets] [DuraSpace JIRA] (DS-2278) Error pages improperly formatted on certain url patterns

0 views
Skip to first unread message

Terry Brady (DuraSpace JIRA)

unread,
Aug 17, 2015, 11:41:21 AM8/17/15
to dspace-...@lists.sourceforge.net
Terry Brady created an issue
 
DSpace / Bug DS-2278
Error pages improperly formatted on certain url patterns
Issue Type: Bug Bug
Affects Versions: 5.0
Assignee: Unassigned
Attachments: screenshot-1.png
Components: XMLUI
Created: 11/Nov/14 7:11 PM
Environment: demo.dspace.org
Priority: Minor Minor
Reporter: Terry Brady
http://demo.dspace.org/xmlui/1111 and http://demo.dspace.org/xmlui/handle/1111 do not display a proper error page

Creating a ticket per https://jira.duraspace.org/browse/DS-2273
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.2.6#6264-sha1:ee76422)
Atlassian logo

Terry Brady (DuraSpace JIRA)

unread,
Aug 17, 2015, 11:41:21 AM8/17/15
to dspace-...@lists.sourceforge.net
Terry Brady updated an issue
Change By: Terry Brady
Attachment: screenshot-1.png

Terry Brady (DuraSpace JIRA)

unread,
Aug 17, 2015, 11:41:22 AM8/17/15
to dspace-...@lists.sourceforge.net
Terry Brady updated an issue
Change By: Terry Brady
Attachment: screenshot-2.png

Tim Donohue (DuraSpace JIRA)

unread,
Aug 17, 2015, 11:41:49 AM8/17/15
to dspace-...@lists.sourceforge.net

Tim Donohue (DuraSpace JIRA)

unread,
Aug 17, 2015, 12:10:21 PM8/17/15
to dspace-...@lists.sourceforge.net
Tim Donohue commented on Bug DS-2278
 
Re: Error pages improperly formatted on certain url patterns

Further explanation on the "redirect" fix for issue #2, based on discussion about this problem with mhwood & hpottinger:

Essentially, the flow of an XMLUI request is somewhat like this:

  • First, any external paths (passed directly on URL) are matched in the main Sitemap.
  • Anything not matched there gets passed directly to the configured Theme Sitemap.
  • The Theme Sitemap simply passes the "path" along to the Aspect Chain (and it becomes an internal Cocoon request), and the Aspect Chain processes aspects (internally) based on the path.

So, by default all URL paths end up becoming "internal" Cocoon requests, and processed by the Aspect Chain...UNLESS they are matched by the main Sitemap (or alternatively the specific Theme's sitemap). As the Aspect Chain assumes that paths beginning with numbers refer to specific AspectIDs, the "chain processing" gets confused when a URL path starting with a number gets passed down to the Aspect Chain.

Therefore, my "fix" was to ensure any paths that begin with a number are "matched" in the main SiteMap and redirected elsewhere (to ensure they never get processed by the Aspect Chain). The most logical redirect was to assume they are likely object identifiers and to redirect them to "/handle"

Tim Donohue (DuraSpace JIRA)

unread,
Aug 17, 2015, 12:18:44 PM8/17/15
to dspace-...@lists.sourceforge.net
Tim Donohue updated an issue
Change By: Tim Donohue
Assignee: Tim Donohue
Status: Volunteer Needed Accepted

Tim Donohue (DuraSpace JIRA)

unread,
Aug 17, 2015, 12:18:46 PM8/17/15
to dspace-...@lists.sourceforge.net
Tim Donohue commented on Bug DS-2278
 
Re: Error pages improperly formatted on certain url patterns

There seems to be two underlying errors here, both of which actually seem to have been in the XMLUI for some time...

Issue #1 When accessing the "/handle" path, DSpace seems to assume that you'll always send a [prefix]/[suffix]. So, if you don't pass a [suffix], then it causes errors. For example:

Issue #2 Paths that begin with a number (0-9) do NOT work properly in the XMLUI. It seems that the XMLUI forwards those paths on to its AspectMatcher, which wrongly assumes that the number references the index of an Aspect in the configured aspect chain (in xmlui.xconf). See this area of the code: https://github.com/DSpace/DSpace/blob/master/dspace-xmlui/src/main/java/org/dspace/app/xmlui/cocoon/AspectMatcher.java#L61

This issue can be seen by accessing any URL beginning with a number, although it results in slightly different displays based on whether that number actually corresponds to a valid AspectID, or not. For example:

I have a PR nearly ready to fix both of these XMLUI issues.

Tim Donohue (DuraSpace JIRA)

unread,
Aug 17, 2015, 12:18:46 PM8/17/15
to dspace-...@lists.sourceforge.net
Tim Donohue updated an issue

Proposed fixes are in this PR. I've tested it locally, but it could use more eyes & comments:

https://github.com/DSpace/DSpace/pull/861

One note is that the only way I found to "fix" Issue #2 (see my previous comment) was to actually redirect those URLs. DSpace does NOT have any valid URLs that start with numbers, so I chose to redirect them all to the "/handle/" path. Therefore http://demo.dspace.org/xmlui/123/456 would now redirect to http://demo.dspace.org/xmlui/handle/123/456 . If the handle exists, the object would be returned. Otherwise the 404 page would be returned.

Change By: Tim Donohue
Status: Accepted Code Review Needed

Tim Donohue (DuraSpace JIRA)

unread,
Aug 17, 2015, 12:20:12 PM8/17/15
to dspace-...@lists.sourceforge.net
Tim Donohue closed an issue as Fixed
 

PR #861 was merged into master and dspace-5_x for the 5.1 release.

Change By: Tim Donohue
Resolution: Fixed
Reviewer: Hardy Pottinger
Status: Code Review Needed Closed
Reply all
Reply to author
Forward
0 new messages