[DS-579] Required fields in submissions display wrong error message

git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@4921 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Ben Bosman
2010-05-12 21:38:30 +00:00
parent a1ce30859c
commit 88994cfc80
2 changed files with 38 additions and 1 deletions

View File

@@ -447,7 +447,11 @@ public class DescribeStep extends AbstractSubmissionStep
if (dcInput.isRequired()) if (dcInput.isRequired())
fullName.setRequired(); fullName.setRequired();
if (isFieldInError(fieldName)) if (isFieldInError(fieldName))
if (dcInput.getWarning() != null && dcInput.getWarning().length() > 0) {
fullName.addError(dcInput.getWarning());
} else {
fullName.addError(T_required_field); fullName.addError(T_required_field);
}
if (dcInput.isRepeatable() && !readonly) if (dcInput.isRepeatable() && !readonly)
fullName.enableAddOperation(); fullName.enableAddOperation();
if ((dcInput.isRepeatable() || dcValues.length > 1) && !readonly) if ((dcInput.isRepeatable() || dcValues.length > 1) && !readonly)
@@ -543,7 +547,11 @@ public class DescribeStep extends AbstractSubmissionStep
if (dcInput.isRequired()) if (dcInput.isRequired())
fullDate.setRequired(); fullDate.setRequired();
if (isFieldInError(fieldName)) if (isFieldInError(fieldName))
if (dcInput.getWarning() != null && dcInput.getWarning().length() > 0) {
fullDate.addError(dcInput.getWarning());
} else {
fullDate.addError(T_required_field); fullDate.addError(T_required_field);
}
if (dcInput.isRepeatable() && !readonly) if (dcInput.isRepeatable() && !readonly)
fullDate.enableAddOperation(); fullDate.enableAddOperation();
if ((dcInput.isRepeatable() || dcValues.length > 1) && !readonly) if ((dcInput.isRepeatable() || dcValues.length > 1) && !readonly)
@@ -632,7 +640,11 @@ public class DescribeStep extends AbstractSubmissionStep
if (dcInput.isRequired()) if (dcInput.isRequired())
fullSeries.setRequired(); fullSeries.setRequired();
if (isFieldInError(fieldName)) if (isFieldInError(fieldName))
if (dcInput.getWarning() != null && dcInput.getWarning().length() > 0) {
fullSeries.addError(dcInput.getWarning());
} else {
fullSeries.addError(T_required_field); fullSeries.addError(T_required_field);
}
if (dcInput.isRepeatable() && !readonly) if (dcInput.isRepeatable() && !readonly)
fullSeries.enableAddOperation(); fullSeries.enableAddOperation();
if ((dcInput.isRepeatable() || dcValues.length > 1) && !readonly) if ((dcInput.isRepeatable() || dcValues.length > 1) && !readonly)
@@ -698,7 +710,11 @@ public class DescribeStep extends AbstractSubmissionStep
if (dcInput.isRequired()) if (dcInput.isRequired())
qualdrop.setRequired(); qualdrop.setRequired();
if (isFieldInError(fieldName)) if (isFieldInError(fieldName))
if (dcInput.getWarning() != null && dcInput.getWarning().length() > 0) {
qualdrop.addError(dcInput.getWarning());
} else {
qualdrop.addError(T_required_field); qualdrop.addError(T_required_field);
}
if (dcInput.isRepeatable() && !readonly) if (dcInput.isRepeatable() && !readonly)
qualdrop.enableAddOperation(); qualdrop.enableAddOperation();
// Update delete based upon the filtered values. // Update delete based upon the filtered values.
@@ -776,7 +792,11 @@ public class DescribeStep extends AbstractSubmissionStep
if (dcInput.isRequired()) if (dcInput.isRequired())
textArea.setRequired(); textArea.setRequired();
if (isFieldInError(fieldName)) if (isFieldInError(fieldName))
if (dcInput.getWarning() != null && dcInput.getWarning().length() > 0) {
textArea.addError(dcInput.getWarning());
} else {
textArea.addError(T_required_field); textArea.addError(T_required_field);
}
if (dcInput.isRepeatable() && !readonly) if (dcInput.isRepeatable() && !readonly)
textArea.enableAddOperation(); textArea.enableAddOperation();
if ((dcInput.isRepeatable() || dcValues.length > 1) && !readonly) if ((dcInput.isRepeatable() || dcValues.length > 1) && !readonly)
@@ -845,7 +865,11 @@ public class DescribeStep extends AbstractSubmissionStep
if (dcInput.isRequired()) if (dcInput.isRequired())
select.setRequired(); select.setRequired();
if (isFieldInError(fieldName)) if (isFieldInError(fieldName))
if (dcInput.getWarning() != null && dcInput.getWarning().length() > 0) {
select.addError(dcInput.getWarning());
} else {
select.addError(T_required_field); select.addError(T_required_field);
}
if (dcInput.isRepeatable() || dcValues.length > 1) if (dcInput.isRepeatable() || dcValues.length > 1)
{ {
// Use the multiple functionality from the HTML // Use the multiple functionality from the HTML
@@ -900,7 +924,11 @@ public class DescribeStep extends AbstractSubmissionStep
if (dcInput.isRequired()) if (dcInput.isRequired())
select.setRequired(); select.setRequired();
if (isFieldInError(fieldName)) if (isFieldInError(fieldName))
if (dcInput.getWarning() != null && dcInput.getWarning().length() > 0) {
select.addError(dcInput.getWarning());
} else {
select.addError(T_required_field); select.addError(T_required_field);
}
if (dcInput.isRepeatable() || dcValues.length > 1) if (dcInput.isRepeatable() || dcValues.length > 1)
{ {
// Use the multiple functionality from the HTML // Use the multiple functionality from the HTML
@@ -974,7 +1002,11 @@ public class DescribeStep extends AbstractSubmissionStep
if (dcInput.isRequired()) if (dcInput.isRequired())
listField.setRequired(); listField.setRequired();
if (isFieldInError(fieldName)) if (isFieldInError(fieldName))
if (dcInput.getWarning() != null && dcInput.getWarning().length() > 0) {
listField.addError(dcInput.getWarning());
} else {
listField.addError(T_required_field); listField.addError(T_required_field);
}
//Setup each of the possible options //Setup each of the possible options
@@ -1050,7 +1082,11 @@ public class DescribeStep extends AbstractSubmissionStep
if (dcInput.isRequired()) if (dcInput.isRequired())
text.setRequired(); text.setRequired();
if (isFieldInError(fieldName)) if (isFieldInError(fieldName))
if (dcInput.getWarning() != null && dcInput.getWarning().length() > 0) {
text.addError(dcInput.getWarning());
} else {
text.addError(T_required_field); text.addError(T_required_field);
}
if (dcInput.isRepeatable() && !readonly) if (dcInput.isRepeatable() && !readonly)
text.enableAddOperation(); text.enableAddOperation();
if ((dcInput.isRepeatable() || dcValues.length > 1) && !readonly) if ((dcInput.isRepeatable() || dcValues.length > 1) && !readonly)

View File

@@ -54,6 +54,7 @@
- [DS-515] Czech localization of 1.5.2 - [DS-515] Czech localization of 1.5.2
(Ben Bosman) (Ben Bosman)
- [DS-579] Required fields in submissions display wrong error message
- [DS-538] restricted items are being returned in OAI GetRecord method while using harvest.includerestricted.oai - [DS-538] restricted items are being returned in OAI GetRecord method while using harvest.includerestricted.oai
- [DS-493] Url in browser is incorrect after login - [DS-493] Url in browser is incorrect after login