I've exported nodes with uuid_features, I use in my content type workbench_moderation states, these states are exported as arrays in uuid_node.
When I revert/recreate nodes from features a couple of errors appears on the site related to workbench_moderation states (see screenshot) because it's expect that moderation states are objects not arrays.
I provided a patch that convert to object workbench moderation states when nodes are rebuilt.

Comments

sdstyles created an issue. See original summary.

sdstyles’s picture

Issue summary: View changes
StatusFileSize
new740 bytes
sdstyles’s picture

Status: Active » Needs review
hussainweb’s picture

Assigned: sdstyles » Unassigned
StatusFileSize
new723 bytes
new699 bytes

I encountered the same error but the patch in #2 only solved some of the warnings. The patch would work fine if the version id's on the nodes don't change. If the feature is deployed on another machine, the id's change and the patch no longer works, as workbench_moderation can't find the vid.

I have changed the patch to use workbench_moderation to load correct states into the node object. Not only does it fix the array problem that the patch in #2 fixes, but it also loads correct vid, making sure everything else goes well.

I tested this on my site and it is working well. I am hoping to see this committed soon.

--

PS I am not entirely sure about this approach but it works. This implies that uuid_features has to worry about converting each and every item in the node object which shouldn't be an array. That makes sense considering that it is features that converts objects to arrays in the first place. Still, I am wondering if it makes more sense to handle this in workbench_moderation module itself. I am leaning towards a no considering that it is features module's responsibility to make sure the node object is back in it's original form. This fix might appear hacky but it seems the best we can do until features writes better support to serialize objects in code.

hussainweb’s picture

StatusFileSize
new576 bytes
new784 bytes

The previous patch generated a warning. The attached patch fixes the warning. The warning was about the node object not having a changed property:

Notice: Undefined property: stdClass::$changed in workbench_moderation_node_data() (line 1203 of /.../workbench_moderation/workbench_moderation.module).