When exporting an entity box, the field data for the boxes is being added to the box table. This is an issue for the following reasons:

  • The content in an entity box is infact content, and not configuration. As such, it probably shouldn't be there in the first place.
  • When working with field collections in entity boxes, the exported box configuration causes errors:
    Call to undefined method FieldCollectionItemEntity::__set_state()

The solution to this is to make sure that the "data" stays with the entity created by entity boxes, and does not get passed off to Boxes to be saved.

Comments

rypit’s picture

Status: Active » Needs review
StatusFileSize
new1.13 KB

Attached is a patch that implements a custom Boxes_Box::save, and saves the entity box after pruning the fields provided by the instance.

rypit’s picture

It may be worthwhile to roll a patch to update all entity boxes so that the data saved in the db is not invalid, too. I'll attach that larger version separately.

rypit’s picture

Attached is a patch that makes the fix as specified in #1, but also includes an install hook to update the existing entity boxes in the database so that their exportable data is not malformed.

jec006’s picture

Status: Needs review » Fixed

Committed thanks.

Status: Fixed » Closed (fixed)

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