Problem/Motivation

Nodeblocks attaches its data on the node entity with nodeblock_node_load(). This allows its data to be exported and imported across environments with the Migrate module. However when importing data, the nodeblock property is not registered as a valid property on the node entity and therefor the Migrate module skips this data when importing the node.

Proposed resolution

By registering 'nodeblock' as a valid property on the entity, Migrate (as well as other modules that work with entity metadata) will save the property with the rest of the node data and the nodeblock data transfers successfully across environments.

Remaining tasks

  1. Write a patch
  2. Review

User interface changes

None

API changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

idebr’s picture

Status: Active » Needs review
FileSize
1.29 KB

Attached patch register nodeblock as a node property, so its data is saved correctly by modules that validate entity properties such as Migrate.

Johnny vd Laar’s picture

Status: Needs review » Needs work

The info array is keyed by entity types. nodeblock is not an entity type. Are you sure that your code is working? Shouldn't type be 'node' ? And you iterate over properties... but shoudn't we just be adding the nodeblock property?

I also think it should be inside a hook_entity_property_info.

And the n00b question... how do I test this. I never use migrate so what should I enable to see how this works.