Fix JS validation for year in publication form.

#5894