Skip to content

Conversation

@bp-cos
Copy link
Contributor

@bp-cos bp-cos commented Jun 3, 2025

Purpose

Collections without meta-data were throwing errors because the attributes object was null.

Summary of Changes

If the attributes object is null then it is instantiated with an empty object

Screenshot(s)

N.A

Side Effects

Lots regarding the user experience which I have documented for Mark.

QA Notes

You will need to turn off all metadata in the admin before testing

image

@bp-cos bp-cos requested a review from futa-ikeda June 3, 2025 20:36
Copy link
Contributor

@futa-ikeda futa-ikeda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a fun one to debug 😬

Comment on lines +14 to +15
const { data, data: { relationships } } = serialized;
data.attributes = data.attributes || { };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future reference, in the case where the provider has no collection-specific metadata (no issue, volume, studyDesign, etc), the collection-submissionhas no attributes, only relationships. So in this case,data.attributesisundefined`, so we need to instantiate it as an empty object

@brianjgeiger brianjgeiger changed the base branch from feature/pbs-25-10 to feature/pbs-25-12 June 30, 2025 17:06
@brianjgeiger
Copy link
Contributor

@brianpilati Could you rebase this on feature/pbs-25-12? For some reason it has extra commits in it, even though the new branch should be later than the previous branch.

@brianjgeiger brianjgeiger changed the base branch from feature/pbs-25-12 to feature/pbs-25-10 June 30, 2025 17:49
@brianjgeiger
Copy link
Contributor

Closed in favor of #2596

@bp-cos bp-cos deleted the bug-fix/ENG-8159 branch June 30, 2025 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants