Last active
August 29, 2015 13:57
-
-
Save pcave/9512002 to your computer and use it in GitHub Desktop.
VBO for refreshing view item
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Refresh queue item VBO action. | |
*/ | |
function salesforce_queue_salesforce_queue_item_refresh_item_action($item) { | |
// Let the individual modules handle the actual object refreshing and queuing. | |
// Check for a TRUE return value because we'll want to leave the item | |
// alone if it is not requeued successfully. | |
if (module_invoke_all('salesforce_queue_refresh_queue_item', $item)) { | |
// Force the item back into the new queue. | |
db_query("UPDATE {saleforce_queue} SET queue = 'new', retries = 0 WHERE item_id = :item_id", | |
array(':item_id' => $item->item_id)); | |
} | |
else { | |
drupal_set_message(t('Item with Drupal Id !id (!module|!delta) could not be refreshed. It was not moved back into the new queue.', array( | |
'!id' => $item->drupal_id, '!module' => $item->module, '!delta' => $item->delta))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment