I have a view with some default (views) bulk operations. I needed some more (such as publish content, ...), so I added them (http://www.zyxware.com/articles/3633/drupal-7-how-to-add-your-own-custom-operation-in-views-bulk-operation-vbo), but now I need to reorder them (so that the "publish content" is first, ... is second and so on) and can not find any way to do that (I tried to use form_alter function (with dsm on the form) on the page, where the view is shown, to debug information about the form in order to find the array containing all the bulk operations (and then rearrange it), but did not found such an array).

Do you have any ideas how to do that?

  • I posted a reply but I misunderstood the question. I checked the VBO code. If I didn't overlook, the module does not explicitly sort the actions list. That means the actions will be added in their definied order (order of the hook_actions_info() )return array and the module weight. – AyeshK Jul 21 '14 at 9:42
  • It seems, that it is not in the defined order. I have the following code (abbreviated): return array( 'publish_selected_content_action' => array( ... ), 'depublish_selected_content_action' => array( ... ), 'indicate_files_permanent_action' => array( ... ), 'indicate_files_temporary_action' => array( ... ), 'promote_selected_files_action' => array(... ), 'demote_selected_files_action' => array( ... ), but the order is: demote, indicate permanent, temp., promote, ... – arahusky Jul 21 '14 at 9:56
  • hide and then publish. It seems that the order is just random. – arahusky Jul 21 '14 at 9:59
  • Now I tried reordering the items in hook_actions_info(), but is still the same (no effect on the item order) – arahusky Jul 21 '14 at 10:44
  • 1
    Tried that, but did not help. Then I realized, that I can try exporting the view and change the order there. After doing that and importing back, everything was as wanted. Thanks – arahusky Jul 21 '14 at 12:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.