I'm working on getting editablefields to play nicely with multifield with the patch from https://www.drupal.org/node/2041533#comment-10713240 to enable multifield support for views.
My first issue was getting editablefields to work on node views. I created a patch at https://www.drupal.org/node/2643362 to get it to play nice with entity_save() that editablefields calls.
Then I moved to getting it working with views. I discussed the issue at https://www.drupal.org/node/2041533#comment-10713240
The main issue is that to play nicely with multifield, we need the entity that editablefields cares about to be the multifield pseudo entity. However editablefields_field_formatter_view calls
// Load the original (unrendered) entity from the cache of the Field API views handler.
$entity = $view->result[$row_id]->_field_data[$views_field->field_alias]['entity'];
Which replaces $entity with the parent entity for the multifield (aka my node).
As a quick work around, I wrapped this a check of the entity_type
// Load the original (unrendered) entity from the cache of the Field API views handler.
if ($entity_type != 'multifield') {
$entity = $view->result[$row_id]->_field_data[$views_field->field_alias]['entity'];
}
But that doesn't seem like a permanent solution. Can someone involved with editablefields give things a look over and recommend if something should change on the multifield side or editable fields needs to handle the different entities involved better?
Comments
Comment #2
bkat CreditAttribution: bkat commented