BUG: Custom Title: Error when adding a second contributor of the same type

Priority

Labels

Environment

None

Template

None

Description

1. Go to folio.frontside.io
2. Search for title [before title test] or use URL https://folio.frontside.io/eholdings/titles/17290132
3. Edit record
4. Add an author Dennis, Miller and an editor Brady, Wayne
5. Save successfully
6. Edit same record and add another author Allen, Ed
7. Hit save and the following error message displays: An unknown error occurred

Same issue can be reproduced when adding identifiers

1. Go to folio.frontside.io

2. Search for title [Mary] or use URL https://folio.frontside.io/eholdings/titles/172364263
3. Edit record
4. Add multiple identifiers
5. Save successfully
6. Edit same record and add another identifier
7. Hit save and the following error message displays: An unknown error occurred

Additional details

https://okapi.frontside.io/eholdings/resources/123355-2867674-17290132

request body
{"data":{"id":"123355-2867674-17290132","type":"resources","attributes":{"description":"","edition":"2nd","isPeerReviewed":true,"isTitleCustom":true,"publisherName":"Wales","titleId":17290132,"contributors":[{"type":"editor","contributor":"Brady, Wayne"},{"type":"author","contributor":"Dennis, Miller"},{"type":"author","contributor":"Allen, Ed"}],"identifiers":[{"id":"978528641"}],"name":"before title test","publicationType":"Journal","subjects":[],"coverageStatement":"","customEmbargoPeriod":{"embargoUnit":null,"embargoValue":0},"isSelected":true,"managedEmbargoPeriod":{"embargoUnit":null,"embargoValue":0},"packageId":"123355-2867674","packageName":"carole create a custom package - 5","url":"","providerId":123355,"providerName":"API DEV CORPORATE CUSTOMER","visibilityData":{"isHidden":false,"reason":""},"managedCoverages":[],"customCoverages":[{"beginCoverage":"2017-04-30","endCoverage":""}]}}}

Response
{"status":500,"error":"Internal Server Error","exception":"#\u003cNoMethodError: undefined method `to_sym' for nil:NilClass\u003e","traces":{"Application Trace":[{"id":0,"trace":"app/deserializable/deserializable_resource.rb:76:in `block (2 levels) in \u003cclass:DeserializableResource\u003e'"},{"id":1,"trace":"app/deserializable/deserializable_resource.rb:75:in `map'"},{"id":2,"trace":"app/deserializable/deserializable_resource.rb:75:in `block in \u003cclass:DeserializableResource\u003e'"},{"id":23,"trace":"app/controllers/application_controller.rb:55:in `catch_flexirest_exceptions'"},{"id":25,"trace":"app/controllers/application_controller.rb:44:in `catch_repository_errors'"},{"id":27,"trace":"app/controllers/application_controller.rb:37:in `catch_exceptions'"},{"id":66,"trace":"app/middleware/chunked_transfer_decoder.rb:58:in `call'"}],"Framework Trace":[{"id":3,"trace":"jsonapi-deserializable (0.2.0) lib/jsonapi/deserializable/resource.rb:100:in `deserialize_attr'"},{"id":4,"trace":"jsonapi-deserializable (0.2.0) lib/jsonapi/deserializable/resource.rb:92:in `block in deserialize_attrs'"},{"id":5,"trace":"jsonapi-deserializable (0.2.0) lib/jsonapi/deserializable/resource.rb:92:in `each'"},{"id":6,"trace":"jsonapi-deserializable (0.2.0) lib/jsonapi/deserializable/resource.rb:92:in `map'"},{"id":7,"trace":"jsonapi-deserializable (0.2.0) lib/jsonapi/deserializable/resource.rb:92:in `deserialize_attrs'"},{"id":8,"trace":"jsonapi-deserializable (0.2.0) lib/jsonapi/deserializable/resource.rb:68:in `deserialize!'"},{"id":9,"trace":"jsonapi-deserializable (0.2.0) lib/jsonapi/deserializable/resource.rb:45:in `initialize'"},{"id":10,"trace":"jsonapi-rails (0.3.1) lib/jsonapi/rails/controller.rb:76:in `new'"},{"id":11,"trace":"jsonapi-rails (0.3.1) lib/jsonapi/rails/controller.rb:76:in `block (2 levels) in deserializable_resource'"},{"id":12,"trace":"activesupport (5.1.6) lib/active_support/notifications.rb:168:in `instrument'"},{"id":13,"trace":"jsonapi-rails (0.3.1) lib/jsonapi/rails/controller.rb:74:in `block in deserializable_resource'"},{"id":14,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:413:in `instance_exec'"},{"id":15,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:413:in `block in make_lambda'"},{"id":16,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:178:in `block (2 levels) in halting_and_conditional'"},{"id":17,"trace":"actionpack (5.1.6) lib/abstract_controller/callbacks.rb:12:in `block (2 levels) in \u003cmodule:Callbacks\u003e'"},{"id":18,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:179:in `block in halting_and_conditional'"},{"id":19,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:507:in `block in invoke_before'"},{"id":20,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:507:in `each'"},{"id":21,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:507:in `invoke_before'"},{"id":22,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:106:in `block in run_callbacks'"},{"id":24,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:117:in `block in run_callbacks'"},{"id":26,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:117:in `block in run_callbacks'"},{"id":28,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:117:in `block in run_callbacks'"},{"id":29,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:135:in `run_callbacks'"},{"id":30,"trace":"actionpack (5.1.6) lib/abstract_controller/callbacks.rb:19:in `process_action'"},{"id":31,"trace":"actionpack (5.1.6) lib/action_controller/metal/rescue.rb:20:in `process_action'"},{"id":32,"trace":"actionpack (5.1.6) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'"},{"id":33,"trace":"activesupport (5.1.6) lib/active_support/notifications.rb:166:in `block in instrument'"},{"id":34,"trace":"activesupport (5.1.6) lib/active_support/notifications/instrumenter.rb:21:in `instrument'"},{"id":35,"trace":"activesupport (5.1.6) lib/active_support/notifications.rb:166:in `instrument'"},{"id":36,"trace":"actionpack (5.1.6) lib/action_controller/metal/instrumentation.rb:30:in `process_action'"},{"id":37,"trace":"actionpack (5.1.6) lib/action_controller/metal/params_wrapper.rb:252:in `process_action'"},{"id":38,"trace":"actionpack (5.1.6) lib/abstract_controller/base.rb:124:in `process'"},{"id":39,"trace":"actionpack (5.1.6) lib/action_controller/metal.rb:189:in `dispatch'"},{"id":40,"trace":"actionpack (5.1.6) lib/action_controller/metal.rb:253:in `dispatch'"},{"id":41,"trace":"actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'"},{"id":42,"trace":"actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:31:in `serve'"},{"id":43,"trace":"actionpack (5.1.6) lib/action_dispatch/journey/router.rb:50:in `block in serve'"},{"id":44,"trace":"actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in `each'"},{"id":45,"trace":"actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in `serve'"},{"id":46,"trace":"actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:844:in `call'"},{"id":47,"trace":"rack (2.0.5) lib/rack/etag.rb:25:in `call'"},{"id":48,"trace":"rack (2.0.5) lib/rack/conditional_get.rb:38:in `call'"},{"id":49,"trace":"rack (2.0.5) lib/rack/head.rb:12:in `call'"},{"id":50,"trace":"actionpack (5.1.6) lib/action_dispatch/middleware/callbacks.rb:26:in `block in call'"},{"id":51,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:97:in `run_callbacks'"},{"id":52,"trace":"actionpack (5.1.6) lib/action_dispatch/middleware/callbacks.rb:24:in `call'"},{"id":53,"trace":"actionpack (5.1.6) lib/action_dispatch/middleware/executor.rb:12:in `call'"},{"id":54,"trace":"actionpack (5.1.6) lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call'"},{"id":55,"trace":"actionpack (5.1.6) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'"},{"id":56,"trace":"railties (5.1.6) lib/rails/rack/logger.rb:36:in `call_app'"},{"id":57,"trace":"railties (5.1.6) lib/rails/rack/logger.rb:24:in `block in call'"},{"id":58,"trace":"activesupport (5.1.6) lib/active_support/tagged_logging.rb:69:in `block in tagged'"},{"id":59,"trace":"activesupport (5.1.6) lib/active_support/tagged_logging.rb:26:in `tagged'"},{"id":60,"trace":"activesupport (5.1.6) lib/active_support/tagged_logging.rb:69:in `tagged'"},{"id":61,"trace":"railties (5.1.6) lib/rails/rack/logger.rb:24:in `call'"},{"id":62,"trace":"actionpack (5.1.6) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'"},{"id":63,"trace":"actionpack (5.1.6) lib/action_dispatch/middleware/request_id.rb:25:in `call'"},{"id":64,"trace":"rack (2.0.5) lib/rack/runtime.rb:22:in `call'"},{"id":65,"trace":"activesupport (5.1.6) lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call'"},{"id":67,"trace":"actionpack (5.1.6) lib/action_dispatch/middleware/executor.rb:12:in `call'"},{"id":68,"trace":"actionpack (5.1.6) lib/action_dispatch/middleware/static.rb:125:in `call'"},{"id":69,"trace":"rack (2.0.5) lib/rack/sendfile.rb:111:in `call'"},{"id":70,"trace":"railties (5.1.6) lib/rails/engine.rb:522:in `call'"},{"id":71,"trace":"puma (3.11.4) lib/puma/configuration.rb:225:in `call'"},{"id":72,"trace":"puma (3.11.4) lib/puma/server.rb:632:in `handle_request'"},{"id":73,"trace":"puma (3.11.4) lib/puma/server.rb:446:in `process_client'"},{"id":74,"trace":"puma (3.11.4) lib/puma/server.rb:306:in `block in run'"},{"id":75,"trace":"puma (3.11.4) lib/puma/thread_pool.rb:120:in `block in spawn_thread'"}],"Full Trace":[{"id":0,"trace":"app/deserializable/deserializable_resource.rb:76:in `block (2 levels) in \u003cclass:DeserializableResource\u003e'"},{"id":1,"trace":"app/deserializable/deserializable_resource.rb:75:in `map'"},{"id":2,"trace":"app/deserializable/deserializable_resource.rb:75:in `block in \u003cclass:DeserializableResource\u003e'"},{"id":3,"trace":"jsonapi-deserializable (0.2.0) lib/jsonapi/deserializable/resource.rb:100:in `deserialize_attr'"},{"id":4,"trace":"jsonapi-deserializable (0.2.0) lib/jsonapi/deserializable/resource.rb:92:in `block in deserialize_attrs'"},{"id":5,"trace":"jsonapi-deserializable (0.2.0) lib/jsonapi/deserializable/resource.rb:92:in `each'"},{"id":6,"trace":"jsonapi-deserializable (0.2.0) lib/jsonapi/deserializable/resource.rb:92:in `map'"},{"id":7,"trace":"jsonapi-deserializable (0.2.0) lib/jsonapi/deserializable/resource.rb:92:in `deserialize_attrs'"},{"id":8,"trace":"jsonapi-deserializable (0.2.0) lib/jsonapi/deserializable/resource.rb:68:in `deserialize!'"},{"id":9,"trace":"jsonapi-deserializable (0.2.0) lib/jsonapi/deserializable/resource.rb:45:in `initialize'"},{"id":10,"trace":"jsonapi-rails (0.3.1) lib/jsonapi/rails/controller.rb:76:in `new'"},{"id":11,"trace":"jsonapi-rails (0.3.1) lib/jsonapi/rails/controller.rb:76:in `block (2 levels) in deserializable_resource'"},{"id":12,"trace":"activesupport (5.1.6) lib/active_support/notifications.rb:168:in `instrument'"},{"id":13,"trace":"jsonapi-rails (0.3.1) lib/jsonapi/rails/controller.rb:74:in `block in deserializable_resource'"},{"id":14,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:413:in `instance_exec'"},{"id":15,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:413:in `block in make_lambda'"},{"id":16,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:178:in `block (2 levels) in halting_and_conditional'"},{"id":17,"trace":"actionpack (5.1.6) lib/abstract_controller/callbacks.rb:12:in `block (2 levels) in \u003cmodule:Callbacks\u003e'"},{"id":18,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:179:in `block in halting_and_conditional'"},{"id":19,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:507:in `block in invoke_before'"},{"id":20,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:507:in `each'"},{"id":21,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:507:in `invoke_before'"},{"id":22,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:106:in `block in run_callbacks'"},{"id":23,"trace":"app/controllers/application_controller.rb:55:in `catch_flexirest_exceptions'"},{"id":24,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:117:in `block in run_callbacks'"},{"id":25,"trace":"app/controllers/application_controller.rb:44:in `catch_repository_errors'"},{"id":26,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:117:in `block in run_callbacks'"},{"id":27,"trace":"app/controllers/application_controller.rb:37:in `catch_exceptions'"},{"id":28,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:117:in `block in run_callbacks'"},{"id":29,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:135:in `run_callbacks'"},{"id":30,"trace":"actionpack (5.1.6) lib/abstract_controller/callbacks.rb:19:in `process_action'"},{"id":31,"trace":"actionpack (5.1.6) lib/action_controller/metal/rescue.rb:20:in `process_action'"},{"id":32,"trace":"actionpack (5.1.6) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'"},{"id":33,"trace":"activesupport (5.1.6) lib/active_support/notifications.rb:166:in `block in instrument'"},{"id":34,"trace":"activesupport (5.1.6) lib/active_support/notifications/instrumenter.rb:21:in `instrument'"},{"id":35,"trace":"activesupport (5.1.6) lib/active_support/notifications.rb:166:in `instrument'"},{"id":36,"trace":"actionpack (5.1.6) lib/action_controller/metal/instrumentation.rb:30:in `process_action'"},{"id":37,"trace":"actionpack (5.1.6) lib/action_controller/metal/params_wrapper.rb:252:in `process_action'"},{"id":38,"trace":"actionpack (5.1.6) lib/abstract_controller/base.rb:124:in `process'"},{"id":39,"trace":"actionpack (5.1.6) lib/action_controller/metal.rb:189:in `dispatch'"},{"id":40,"trace":"actionpack (5.1.6) lib/action_controller/metal.rb:253:in `dispatch'"},{"id":41,"trace":"actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'"},{"id":42,"trace":"actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:31:in `serve'"},{"id":43,"trace":"actionpack (5.1.6) lib/action_dispatch/journey/router.rb:50:in `block in serve'"},{"id":44,"trace":"actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in `each'"},{"id":45,"trace":"actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in `serve'"},{"id":46,"trace":"actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:844:in `call'"},{"id":47,"trace":"rack (2.0.5) lib/rack/etag.rb:25:in `call'"},{"id":48,"trace":"rack (2.0.5) lib/rack/conditional_get.rb:38:in `call'"},{"id":49,"trace":"rack (2.0.5) lib/rack/head.rb:12:in `call'"},{"id":50,"trace":"actionpack (5.1.6) lib/action_dispatch/middleware/callbacks.rb:26:in `block in call'"},{"id":51,"trace":"activesupport (5.1.6) lib/active_support/callbacks.rb:97:in `run_callbacks'"},{"id":52,"trace":"actionpack (5.1.6) lib/action_dispatch/middleware/callbacks.rb:24:in `call'"},{"id":53,"trace":"actionpack (5.1.6) lib/action_dispatch/middleware/executor.rb:12:in `call'"},{"id":54,"trace":"actionpack (5.1.6) lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call'"},{"id":55,"trace":"actionpack (5.1.6) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'"},{"id":56,"trace":"railties (5.1.6) lib/rails/rack/logger.rb:36:in `call_app'"},{"id":57,"trace":"railties (5.1.6) lib/rails/rack/logger.rb:24:in `block in call'"},{"id":58,"trace":"activesupport (5.1.6) lib/active_support/tagged_logging.rb:69:in `block in tagged'"},{"id":59,"trace":"activesupport (5.1.6) lib/active_support/tagged_logging.rb:26:in `tagged'"},{"id":60,"trace":"activesupport (5.1.6) lib/active_support/tagged_logging.rb:69:in `tagged'"},{"id":61,"trace":"railties (5.1.6) lib/rails/rack/logger.rb:24:in `call'"},{"id":62,"trace":"actionpack (5.1.6) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'"},{"id":63,"trace":"actionpack (5.1.6) lib/action_dispatch/middleware/request_id.rb:25:in `call'"},{"id":64,"trace":"rack (2.0.5) lib/rack/runtime.rb:22:in `call'"},{"id":65,"trace":"activesupport (5.1.6) lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call'"},{"id":66,"trace":"app/middleware/chunked_transfer_decoder.rb:58:in `call'"},{"id":67,"trace":"actionpack (5.1.6) lib/action_dispatch/middleware/executor.rb:12:in `call'"},{"id":68,"trace":"actionpack (5.1.6) lib/action_dispatch/middleware/static.rb:125:in `call'"},{"id":69,"trace":"rack (2.0.5) lib/rack/sendfile.rb:111:in `call'"},{"id":70,"trace":"railties (5.1.6) lib/rails/engine.rb:522:in `call'"},{"id":71,"trace":"puma (3.11.4) lib/puma/configuration.rb:225:in `call'"},{"id":72,"trace":"puma (3.11.4) lib/puma/server.rb:632:in `handle_request'"},{"id":73,"trace":"puma (3.11.4) lib/puma/server.rb:446:in `process_client'"},{"id":74,"trace":"puma (3.11.4) lib/puma/server.rb:306:in `block in run'"},{"id":75,"trace":"puma (3.11.4) lib/puma/thread_pool.rb:120:in `block in spawn_thread'"}]}}

Development Team

None

Release

None

Story Points

Sprint

Checklist

hide

TestRail: Results

Activity

Show:

Carole GodfreyJune 8, 2018 at 1:01 PM
Edited

This is same problem as noted in

I deleted the existing identifier on the below custom title. We no longer see the issue adding contributors since the
identifier with missing type and subtype is no longer passed in payload.

https://folio.frontside.io/eholdings/titles/17290132

Carole GodfreyJune 4, 2018 at 7:56 PM

6/4

Believe issue is with identifiers collection in the payload - in PUT request, identifier object (such as below) is missing the type and subtype.

identifiers":[
{"id":"978528641"}
]

Trace in error returned
"trace": "app/deserializable/deserializable_resource.rb:76:in `block (2 levels) in <class:DeserializableResource>'"

Code in deserializable-resource.rb (line 76)

values.map do |identifier|

  • type_key = identifier['type'].to_sym*
    subtype_key = identifier['subtype'].to_sym
    identifier['type'] = types[type_key]
    identifier['subtype'] = subtypes[subtype_key]
    end
    { identifiersList: values }

Done

Details

Assignee

Reporter

Fix versions

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created May 24, 2018 at 2:16 PM
Updated September 7, 2018 at 1:49 PM
Resolved June 14, 2018 at 2:15 PM
TestRail: Cases
TestRail: Runs