Project

General

Profile

« Previous | Next » 

Revision 4730

Added by walbridge almost 16 years ago

Include error checking for required distribution elements, which must be non-empty strings in EML 2.1 (bug #3721).

View differences:

src/perl/register-dataset.cgi
739 739
        }
740 740
    }
741 741

  
742
    # check required distribution elements
743
    push(@invalidParams, "Data medium is required.")
744
    unless (hasContent($FORM::dataMedium));
745
    if ($FORM::dataMedium eq 'other') {
746
        push(@invalidParams, "Must enter custom data medium when 'other' is selected.")
747
        unless (hasContent($FORM::dataMediumOther));
748
    }
749
    push(@invalidParams, "Usage rights are required.")
750
    unless (hasContent($FORM::useConstraints));
751
    if ($FORM::useConstraints eq 'other') {
752
        push(@invalidParams, "Must enter custom usage rights when 'other' is selected.")
753
        unless (hasContent($FORM::useConstraintsOther));
754
    }
755

  
742 756
    return \@invalidParams;
743 757
}
744 758

  

Also available in: Unified diff