BundleContentImp ID is always -1

Description

BundleContentImp objects always have an ID of -1. There are are two cases where this is observable:
(1) the BundleContentImp constructor, and (2) the BundleService addContentToBundle(BundleContentImp bundleContentImp) method.

The below test case demonstrates this behavior:

Environment

None

Activity

Show:
Christina Jenks
July 14, 2020, 10:40 AM

Forgot to add the helper methods for reference:

Deniz Oğuz
July 14, 2020, 11:08 PM

Hi Christina,
Thanks for taking your time and sending a detailed report. I have fixed it in our repo and it should be a part of next release. You are probably already doing it but you can set bundleContentImp.id from bundleContent.id within your code. Actually our Rest API is doing this, so when you get content of a bundle from Rest API it is correctly setting ids.

Christina Jenks
July 15, 2020, 5:54 AM

Thanks! Yep, figured that out

Only part where it’s annoying is creating/updating a BundleContentImp (addContentToBundle or updateBundleContent) – since it didn’t have an ID set, I have to make a second call to get it again (getBundleContent).

Thanks for your help!

Fixed

Assignee

Deniz Oğuz

Reporter

Christina Jenks

Labels

None

Source

None

Jira Version

Database Type/Version

H2 / local in-memory

Browser Type/Version

n/a

Fix versions

Affects versions

Priority

Major
Configure