I was defining & organizing my custom operations in main & sub categories.
So, in hook_entity_operation_info_alter operations are reported like
'foo/main' => array(
'handler' => 'EntityOperationsOperationFooMain',
'provision' => array(
'menu' => array('default secondary' => TRUE, ),
'views field' => TRUE,
),
),
'foo/bar' => array(
'handler' => 'EntityOperationsOperationFooBar',
'provision' => array(
'menu' => TRUE,
'views field' => TRUE,
),
),
The handler EntityOperationsOperationFooBar is extending EntityOperationsOperationAction class to inherit vbo feature.
Unfortunately, when I build a VBO view & try to enable this operation, I'm facing an JS error due to an input DOM ID composed with a slash '/' in the label.
Finally, I was able to fix the issue modifying the operation id sent by entity_operation to vbo module in file plugins/operation_types/entity_operation.inc, function entity_operations_vbo_entity_operations_list :
Replace line 47
$new_operation_id = implode('::', array('entity_operation', $entity_type, $key));
by
$new_operation_id = implode('::', array('entity_operation', $entity_type, str_replace( '/' , '-' , $key)));
to replace secondary menu slash by another character ('-' in my case)
Hope this will help.
Comments
Comment #1
joachim commentedThanks for reporting this & suggesting a fix.
Any chance you could make a patch for that?
(BTW: the issue tags field is not meant for keywords.)