Fix for SF bug [2541285] Submission Forms don't preserve order of values

git-svn-id: http://scm.dspace.org/svn/repo/branches/dspace-1_5_x@3394 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Tim Donohue
2009-01-27 21:08:16 +00:00
parent b5a010cd7d
commit 8b7694be2d
2 changed files with 15 additions and 11 deletions

View File

@@ -769,7 +769,7 @@ public class DescribeStep extends AbstractProcessingStep
{
List vals = new LinkedList();
int i = 0;
int i = 1; //start index at the first of the previously entered values
boolean foundLast = false;
log.debug("getRepeatedParameter: metadataField=" + metadataField
@@ -779,11 +779,20 @@ public class DescribeStep extends AbstractProcessingStep
while (!foundLast)
{
String s = null;
if (i == 0)
s = request.getParameter(param);
else
//First, add the previously entered values.
// This ensures we preserve the order that these values were entered
s = request.getParameter(param + "_" + i);
// If there are no more previously entered values,
// see if there's a new value entered in textbox
if (s==null)
{
s = request.getParameter(param);
//this will be the last value added
foundLast = true;
}
// We're only going to add non-null values
if (s != null)
{
@@ -810,12 +819,6 @@ public class DescribeStep extends AbstractProcessingStep
if (addValue)
vals.add(s.trim());
}
else
{
// If the value was null (as opposed to present,
// but empty) we've reached the last name
foundLast = true;
}
i++;
}

View File

@@ -52,6 +52,7 @@
- [2462293] Enable Google Sitemaps for XMLUI
- Fixed small bug in XMLUI's org.dspace.app.xmlui.cocoon.DSpaceMETSGenerator which caused Repository-wide METS file to fail to generate.
- [2477820] DSpace 1.5 XMLUI - Enable METS <amdSec> using crosswalks
- Fix for SF bug [2541285] Submission Forms don't preserve order of values
(Kim Shepherd)
- [2385187] Fix for toDate method in DCDate