We're updating the issue view to help you get more done. 

BaseModelWithAttributes and descendants do NOT return pk after inserts!

Description

Whenever a record is added through insert() the result should either be false or the PK of the newly created record. I noticed that this is not the case because i was using the SOAP services (UserContent/addSet) and expected the set_id as a return value. Instead i got false even upon success.

I believe the reason for this is a bug in BaseModelWithAttributes and BundlableLabelableBaseModelWithAttributes. There, the return value of the calls to parent::insert are ignored. Please review the patch I attached. It works for me but i'm unsure whether this has repercussions anywhere else. We would like to get this upstream asap.

I am having this problem on both the trunk and cleanup_before_release branch.

Environment

lamp

Activity

Show:
User known
February 20, 2012, 11:10 AM

I merged the change to BaseModelWithAttributes in cleanup_before_release
The one in BundlableLabelableBaseModelWithAttributes was already in cleanup_before_release.

Thimo Thoeye
February 20, 2012, 11:42 AM

Thanks!

Mark Chung
March 5, 2012, 4:01 PM

Thanks for the fix - this also explains why the md5 and original_filename fields of ca_object_representations were not set on insert, but only on update.

Fixed

Assignee

User known

Reporter

Thimo Thoeye

Labels

None

Affects versions

Priority

Major
Configure