Download & Extend

Imports fail for entity types without custom entity class--is_new flag not set

Project:Entity API
Version:7.x-1.x-dev
Component:Entity CRUD controller
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

EntityAPIController::create() sets an is_new flag, but only if the entity type has a custom 'entity class' set. Because of this, exportables support fails for entity types that don't use a custom class. The is_new flag is not set so an update rather than insert is triggered. As there's nothing to update, the code-based entity is not created.

Ran into this problem when trying to add exportable support for wysiwyg in #624018: Exportables and Features support for WYSIWYG 7.x.

Solution looks to be to pull the is_new flag setting out of the if clause in EntityAPIController::create().

Comments

#1

Status:active» needs review

Draft patch, untested.

AttachmentSizeStatusTest resultOperations
624018-133-wysiwyg-entity-exportables.patch5.06 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 624018-133-wysiwyg-entity-exportables_1.patch.View details
1047032-1-entity-create-is_new.patch942 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 273 pass(es).View details

#2

Oops, only meant to upload the second of those.

#3

Status:needs review» fixed

Good catch, committed.

>Ran into this problem when trying to add exportable support for wysiwyg in #624018: Exportables and Features support.
Oh, I wasn't aware of that. Awesome!

#4

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.