I guess this isn't truly a support request for UC Views, but I'm still having the issue with #1541370: Move to next state moves orders two states
So I created a new action as part of uc_views_bulk_operations that moves orders to a specific state (rather than the next state). It works fine, but I usually prefer to put tweaks like this in their own module. Yet I can't get the callback function to fire. So let's say my tweaks module is TD Tweaks and the main file is td_tweaks.module. In that file, I create a new action and callback function that are the same ones I'm using in my hacked version of uc_views_bulk_operations, just renamed to td_tweaks_*
/**
* Implementation of hook_node_operations(). (rather, hook_order_operations, which is based off the other)
*/
function td_tweaks_order_operations() {
return array(
'move_orders_to_processing' => array(
'label' => t('Move to Processing'),
'callback' => 'td_weaks_orders_move_orders_to_processing',
'disabled' => TRUE,
),
);
}So far so good - I can add this action and it shows up on the form. But the callback function never fires.
function td_tweaks_orders_move_orders_to_processing($order_ids) {
drupal_set_message("In callback for oder processing");
dpm($order_ids, "Order IDs");
}
In other words, just trying to get the callback to fire, print out the order IDs (using devel and krumo) and setting a message. Once I get that to fire, I'll think about what I actually want it to do. But I can't seem to get the action to fire.
I know this is not truly a uc_views issue, but was hoping this was a good place to ask someone to point me in the right direction and figured anyone else trying to do something similar might look here. Thanks!
Comments
Comment #1
longwaveThere is a typo in your 'callback' definition, td_weaks instead of td_tweaks? Otherwise I don't see why this wouldn't fire.
Comment #2
ergophobe commentedWow! That is colossally stupid and embarrassing. No wonder my workaround worked... no typos!! Can't believe I didn't see that at the time. Much thanks Longwave for bothering to look at that after all this time.
For future reference, this is what it should look like in the working version.
Comment #3
longwaveHehe, glad I could help even if it was a bit late!