Digital object components should be able to be created with only Dates

Description

A valid digital object component contains one or more of the following: label, title, or Dates sub-record. As of 2.8.0 a digital object component created only with a Date sub-record will not save. I get this instead:

I checked 2.7.1 (and just to verify, 2.6.0) and this did work correctly in previous versions.

errors from archivesspace.out log are

D, [2020-10-14T20:49:30.841000 #15884] DEBUG – : Thread-2020: POST /repositories/2/digital_object_components [session: #<Session:0x6ff09182 @store={:user=>"admin", :login_time=>2020-10-14 20:43:26 -0400, :expirable=>true}, @system_mtime=2020-10-15 00:49:30 UTC, @id="6e0b2c0635a6251cc9572c89a4732eda82a0325eb071916e139af75034863c13">]
D, [2020-10-14T20:49:30.860000 #15884] DEBUG – : Thread-2020: Post-processed params: {:digital_object_component=>#<JSONModel(:digital_object_component) {"digital_object"=>{"ref"=>"/repositories/2/digital_objects/1"}, "publish"=>true, "dates"=>[{"label"=>"creation", "expression"=>"this do component has no title or label", "date_type"=>"inclusive", "begin"=>"1979", "end"=>"1990"}], "is_slug_auto"=>false, "jsonmodel_type"=>"digital_object_component", "external_ids"=>[], "subjects"=>[], "extents"=>[], "lang_materials"=>[], "external_documents"=>[], "rights_statements"=>[], "linked_agents"=>[], "file_versions"=>[], "notes"=>[], "linked_events"=>[]}>, :repo_id=>2}
E, [2020-10-14T20:49:30.891000 #15884] ERROR – : Thread-2020: Unhandled exception!
E, [2020-10-14T20:49:30.907000 #15884] ERROR – :
undefined method `+' for nil:NilClass
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_any/webapp/WEB-INF/app/model/digital_object_component.rb:66:in `produce_display_string'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_any/webapp/WEB-INF/app/model/digital_object_component.rb:34:in `block in DigitalObjectComponent'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_any/webapp/WEB-INF/app/model/mixins/auto_generator.rb:34:in `block in create_from_json'
org/jruby/RubyArray.java:1735:in `each'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_any/webapp/WEB-INF/app/model/mixins/auto_generator.rb:32:in `create_from_json'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_any/webapp/WEB-INF/app/model/mixins/notes.rb:152:in `create_from_json'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_any/webapp/WEB-INF/app/model/mixins/publishable.rb:23:in `create_from_json'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_any/webapp/WEB-INF/app/model/mixins/touch_records.rb:41:in `create_from_json'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_any/webapp/WEB-INF/app/lib/crud_helpers.rb:11:in `handle_create'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_any/webapp/WEB-INF/app/controllers/digital_object_component.rb:11:in `block in ArchivesSpaceService'
org/jruby/RubyBasicObject.java:1691:in `instance_eval'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_any/webapp/WEB-INF/app/lib/rest.rb:357:in `block in returns'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_any/webapp/WEB-INF/app/model/db.rb:111:in `block in open'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_any/webapp/WEB-INF/app/model/db.rb:75:in `block in transaction'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sequel-4.20.0/lib/sequel/database/transactions.rb:134:in `_transaction'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sequel-4.20.0/lib/sequel/database/transactions.rb:108:in `block in transaction'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sequel-4.20.0/lib/sequel/connection_pool/threaded.rb:98:in `hold'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sequel-4.20.0/lib/sequel/database/connecting.rb:255:in `synchronize'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sequel-4.20.0/lib/sequel/database/transactions.rb:97:in `transaction'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_any/webapp/WEB-INF/app/model/db.rb:74:in `transaction'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_any/webapp/WEB-INF/app/model/db.rb:110:in `block in open'
org/jruby/RubyFixnum.java:305:in `times'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_any/webapp/WEB-INF/app/model/db.rb:107:in `open'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_any/webapp/WEB-INF/app/model/db.rb:432:in `block in DB'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_any/webapp/WEB-INF/app/lib/rest.rb:339:in `block in returns'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_any/webapp/WEB-INF/app/lib/request_context.rb:24:in `open'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_any/webapp/WEB-INF/app/lib/rest.rb:307:in `block in returns'
org/jruby/RubyMethod.java:111:in `call'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1611:in `block in compile!'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:975:in `block in route!'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:994:in `route_eval'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:975:in `block in route!'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1015:in `block in process_route'
org/jruby/RubyKernel.java:1138:in `catch'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1013:in `process_route'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:973:in `block in route!'
org/jruby/RubyArray.java:1735:in `each'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:972:in `route!'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1085:in `block in dispatch!'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in `block in invoke'
org/jruby/RubyKernel.java:1138:in `catch'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in `invoke'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1082:in `dispatch!'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:907:in `block in call!'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in `block in invoke'
org/jruby/RubyKernel.java:1138:in `catch'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in `invoke'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:907:in `call!'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:895:in `call'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_any/webapp/WEB-INF/app/main.rb:292:in `call'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/rack-protection-1.5.5/lib/rack/protection/xss_header.rb:18:in `call'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/rack-protection-1.5.5/lib/rack/protection/path_traversal.rb:16:in `call'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/rack-protection-1.5.5/lib/rack/protection/json_csrf.rb:18:in `call'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/rack-protection-1.5.5/lib/rack/protection/base.rb:49:in `call'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/rack-protection-1.5.5/lib/rack/protection/base.rb:49:in `call'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/rack-protection-1.5.5/lib/rack/protection/frame_options.rb:31:in `call'
uri:classloader:/vendor/rack-1.6.8/rack/nulllogger.rb:9:in `call'
uri:classloader:/vendor/rack-1.6.8/rack/head.rb:13:in `call'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:182:in `call'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:2013:in `call'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1487:in `block in call'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1787:in `synchronize'
C:/Users/dibella/Documents/aspace_installs/archivesspace-v2.8.0/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1487:in `call'
uri:classloader:/vendor/rack-1.6.8/rack/urlmap.rb:66:in `block in call'
org/jruby/RubyArray.java:1735:in `each'
uri:classloader:/vendor/rack-1.6.8/rack/urlmap.rb:50:in `call'
uri:classloader:/rack/handler/servlet.rb:22:in `call'
D, [2020-10-14T20:49:30.907000 #15884] DEBUG – : Thread-2020: Responded with [500, {"Content-Type"=>"application/json", "Cache-Control"=>"private, must-revalidate, max-age=0", "Content-Length"=>"50"}, ["{\"error\":\"undefined method `+' for nil:NilClass\"}\n"]]... in 68ms
I, [2020-10-14T20:49:30.907000 #15884] INFO – : Completed 500 Internal Server Error in 1548ms
F, [2020-10-14T20:49:30.918000 #15884] FATAL – :
F, [2020-10-14T20:49:30.918000 #15884] FATAL – : Exception (Unknown response: {"error":"undefined method `+' for nil:NilClass"}
(code: 500)):
F, [2020-10-14T20:49:30.934000 #15884] FATAL – :
F, [2020-10-14T20:49:30.934000 #15884] FATAL – : app/controllers/application_controller.rb:136:in `handle_crud'
app/controllers/digital_object_components_controller.rb:43:in `create'

Environment

None
Done

Assignee

Lora Woodford

Reporter

Christine Di Bella

Labels

Fix versions

Priority

Minor