Patch to fix reprocess

cameronp - February 5, 2009 - 10:55
Project:Media Mover
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi there, here is a quick update to get reprocessing of media mover configurations working

/**
* Submit form data from the rerun form
*
* @param string $form
* @param array $form_state
*/
function media_mover_api_rerun_node_form_submit($form, &$form_state) {
// first delete existing files for this node if we have them

$files = $form_state['values']['node']->media_mover[$form_state['values']['configuration']->cid];

if ($files) {
foreach($files as $file) {
media_mover_api_file_delete_call($file);
}
// set a message that we did this
if (user_access('see media mover messages')) {
drupal_set_message(t('Deleted previously harvested files from: %title', array('%title' => $form_state['values']['node']->title)));
}
watchdog('Media Mover', 'Deleted media mover transcoded files from '. l($form_state['values']['node']->title, drupal_get_path_alias('node/'. $form_state['values']['node']->nid)));
}
// now rerun the config on this nid and set the output
drupal_set_message(media_mover_api_run_config($form_state['values']['configuration'], true, $form_state['values']['node']->nid));
// clear the cache so the node is rebuilt
cache_clear_all('media_mover_files_node_'. $form_state['values']['node']->nid, 'cache_media_mover', true);
$form_state['redirect'] = 'node/'. $form_state['values']['node']->nid;

}

In media_mover_api_menu.inc for this call, it also needed fixing up , as below

$items['media_mover/rerun/%/node/%'] = array(
'title' => 'Rerun process',
'page callback' => 'drupal_get_form',
'access arguments' => array('administer media_mover'),
'type' => MENU_CALLBACK,
'page arguments' => array('media_mover_api_rerun_node_form', 2, 4),
);

#1

arthurf - February 8, 2009 - 23:52
Status:needs review» fixed

Thanks for submitting the code improvements. I missed this in my D6 conversion. In the future, would you mind submitting your changes as a patch (see: http://drupal.org/patch/create)? It makes it easier for figure out your changes.

#2

cameronp - February 9, 2009 - 02:05

Sure, shall do...

#3

System Message - February 23, 2009 - 02:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

#4

cameronp - October 6, 2009 - 06:38
Status:closed» active

I've just downloaded the latest version, and found this still isnt fixed up, so have created a patch and will attach it..

Thanks,
Cameron

AttachmentSize
reprocess.patch 1.87 KB

#5

cameronp - October 6, 2009 - 07:27

Opps there was a couple of things I misssed, in the original one.

Here it is.

AttachmentSize
reprocess.patch 2.94 KB
 
 

Drupal is a registered trademark of Dries Buytaert.