Incorrect values displaying in "Acquisition method" column in "Agreements for this e-resource" MCL

Description

Overview:
When viewing an e-resource Title (e.g. https://folio-snapshot.dev.folio.org/erm/eresources/b6b566b2-7334-4343-b872-4ae6b474edea) in the "Agreements for this e-resource" the content of the Acquisition method column displays "Title" instead of "Package" when the resource in the agreement line is a Package

Steps to Reproduce:

  1. Create Agreement

  2. Add package to Agreement

  3. Find title that is in the package and view that title

Expected Results:
Acquisition method column should contain "Package" (or appropriate translation dependent on locale)

Actual Results:
Acquisition method column reads "Title"

Additional Information:
The Acquisition method is derived from a "class" returned from the backend. The problem is caused by Grails 4 upgrade. Classes are often proxied and Grails 3 would usually unwrap these automatically. Grails 4 does less automatic unwrapping so some of the backend classes are coming through as proxied

Currently the acquisition method in this screen is obtained by interpreting results.resource.class (see JSON below).

Fix could be done frontend by using results.resource._object.class instead which gives the correct class for the relevant object. I think this is https://github.com/folio-org/ui-agreements/blob/6b98959388153259788e4f6d2ab3cb06216ac6d7/src/components/EntitlementsAgreementsList/EntitlementAgreementsList.js#L51

Example JSON response from

{ "results": [ { "id": "eaa2ddc0-8893-4dd7-8d53-91f9d2b7ad62", "tags": [], "owner": { <agreement details> }, "resource": { "id": "9aa8c96e-fc17-4f68-8db9-9afc206eacb3", "class": "org.olf.kb.ErmResource$HibernateProxy$Q80yWYmF", "name": "Edward Elgar:Edward Elgar E-Book Archive in Business & Management, Economics and Finance:Nationallizenz", "suppressFromDiscovery": false, "tags": [], "customCoverage": false, "_object": { "id": "9aa8c96e-fc17-4f68-8db9-9afc206eacb3", "class": "org.olf.kb.Pkg", "dateCreated": "2020-09-24T01:47:14Z", "tags": [], "lastUpdated": "2020-09-24T01:47:14Z", "vendor": { "id": "7f82ee13-cfce-4999-88dd-fcffdcb4f9df", "name": "Edward Elgar", "orgsUuid_object": { "error": 400, "message": "Bad Request" } }, "coverage": [], "source": "GOKb", "remoteKb": { <remote kb details> }, "name": "Edward Elgar:Edward Elgar E-Book Archive in Business & Management, Economics and Finance:Nationallizenz", "suppressFromDiscovery": false, "reference": "Edward_Elgar:Edward_Elgar_E-Book_Archive_in_Business_&_Management,_Economics_and_Finance:Nationalliz", "resourceCount": 2540 } } } ], "pageSize": 100, "page": 1, "totalPages": 1, "meta": {}, "totalRecords": 1, "total": 1 }

CSP Request Details

None

CSP Rejection Details

None

Potential Workaround

None

Attachments

1
  • 24 Sep 2020, 01:39 PM

relates to

Checklist

hide

TestRail: Results

Activity

Show:

Ethan Freestone October 5, 2020 at 10:28 AM

, do we try to avoid keying off of the `_object` in general? If so then this should be fixed in the backend (And perhaps should anyway) but if not then that's potentially a far quicker fix.

Owen Stephens September 30, 2020 at 3:12 PM

I'm not sure. It could be fixed in either place

Claudia Malzer September 29, 2020 at 10:29 AM

Shouldn't we rather fix this in the backend, , ?
I have no idea how but I think it should come from here?

Done

Details

Assignee

Reporter

Components

Priority

Sprint

Development Team

Bienenvolk

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs
Created September 24, 2020 at 1:52 PM
Updated October 9, 2020 at 3:38 PM
Resolved October 9, 2020 at 3:38 PM
TestRail: Cases
TestRail: Runs

Flag notifications