Modified: trunk/app/controllers/workflows_controller.rb (2269 => 2270)
--- trunk/app/controllers/workflows_controller.rb 2009-09-08 12:54:20 UTC (rev 2269)
+++ trunk/app/controllers/workflows_controller.rb 2009-09-11 15:14:13 UTC (rev 2270)
@@ -743,6 +743,16 @@
when "create_version" then view_to_render_on_fail = "new_version"
end
+ # Check that they selected a Workflow Type.
+
+ if params[:metadata_choice] == 'custom' && params[:workflow][:type] == 'Select...'
+ respond_to do |format|
+ flash.now[:error] = "You selected custom metadata but did not specify a workflow type"
+ format.html { render :action ="" view_to_render_on_fail }
+ end
+ return false
+ end
+
# If a custom workflow type has been specified, check that it is not "Other" or "other" as this can cause havoc in the UI.
if params[:metadata_choice] == 'custom' && params[:workflow][:type] && params[:workflow][:type].downcase == 'other'
Modified: trunk/app/views/workflows/_main_metadata_form.rhtml (2269 => 2270)
--- trunk/app/views/workflows/_main_metadata_form.rhtml 2009-09-08 12:54:20 UTC (rev 2269)
+++ trunk/app/views/workflows/_main_metadata_form.rhtml 2009-09-11 15:14:13 UTC (rev 2270)
@@ -49,7 +49,7 @@
<span class="required">*</span>
</p>
<%= select_tag "workflow[type]",
- options_for_select(workflow_types, (params[:workflow].nil? ? nil : params[:workflow][:type])),
+ options_for_select(['Select...'] + workflow_types, (params[:workflow].nil? ? nil : params[:workflow][:type])),
: "if (this.value == 'Other') { $('workflow[type_other]').show(); $('workflow[type_other]').focus(); } else { $('workflow[type_other]').hide(); }",
:style => "vertical-align: middle;" -%>
<%= text_field_tag "workflow[type_other]",