I had one of my feeds freeze up and I can’t unlock it. I did some searching and found a function for adding an unlock tab form this page:
<?php
function feeds_unlock_tab_form($form, &$form_state, $importer_id, $node = NULL) {
if (empty($node)) {
$source = feeds_source($importer_id);
$form['#redirect'] = 'import/' . $source->id;
}
else {
$importer_id = feeds_get_importer_id($node->type);
$source = feeds_source($importer_id, $node->nid);
$form['#redirect'] = 'node/' . $source->feed_nid;
}
// Form cannot pass on source object.
$form['#importer_id'] = $source->id;
$form['#feed_nid'] = $source->feed_nid;
$form['source_status'] = array(
'#type' => 'fieldset',
'#title' => t('Status'),
'#tree' => TRUE,
'#value' => feeds_source_status($source),
);
$form = confirm_form($form, t('Unlock this importer?'), $form['#redirect'], '', t('Delete'), t('Cancel'), 'confirm feeds update');
if ($source->progressImporting() == FEEDS_BATCH_COMPLETE && $source->progressClearing() == FEEDS_BATCH_COMPLETE) {
$form['source_locked'] = array(
'#type' => 'markup',
'#title' => t('Not Locked'),
'#tree' => TRUE,
'#markup' => t('This importer is not locked, therefore it cannot be unlocked.'),
);
$form['actions']['submit']['#disabled'] = TRUE;
$form['actions']['submit']['#value'] = t('Unlock (disabled)');
}
else {
$form['actions']['submit']['#value'] = t('Unlock');
}
return $form;
} ?>
File
contributions/feeds/feeds.pages.inc, line 202
Menu callbacks, form callbacks and helpers.
So I know it goes in the feeds.pages.inc but not sure how to implement this. Can someone please point me in the right direction, thanks!