Skip to content
Snippets Groups Projects
Commit 05422fed authored by twistor's avatar twistor Committed by Chris Leppanen
Browse files

Issue #2497729 by twistor: Implement all methods on FeedsMissingPlugin

parent c17412e2
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,8 @@ function _feeds_feeds_plugins() { ...@@ -21,7 +21,8 @@ function _feeds_feeds_plugins() {
), ),
); );
$info['FeedsMissingPlugin'] = array( $info['FeedsMissingPlugin'] = array(
'hidden' => TRUE, 'name' => 'Missing plugin',
'description' => 'There is a problem with your configuration.',
'handler' => array( 'handler' => array(
'class' => 'FeedsMissingPlugin', 'class' => 'FeedsMissingPlugin',
'file' => 'FeedsPlugin.inc', 'file' => 'FeedsPlugin.inc',
......
...@@ -315,7 +315,8 @@ function feeds_ui_edit_page(FeedsImporter $importer, $active = 'help', $plugin_k ...@@ -315,7 +315,8 @@ function feeds_ui_edit_page(FeedsImporter $importer, $active = 'help', $plugin_k
break; break;
case 'mapping': case 'mapping':
$active_container['title'] = t('Mapping for !processor', array('!processor' => $plugins[$config['processor']['plugin_key']]['name'])); $processor_name = isset($plugins[$config['processor']['plugin_key']]['name']) ? $plugins[$config['processor']['plugin_key']]['name'] : $plugins['FeedsMissingPlugin']['name'];
$active_container['title'] = t('Mapping for @processor', array('@processor' => $processor_name));
$active_container['body'] = drupal_get_form('feeds_ui_mapping_form', $importer); $active_container['body'] = drupal_get_form('feeds_ui_mapping_form', $importer);
break; break;
} }
...@@ -349,7 +350,7 @@ function feeds_ui_edit_page(FeedsImporter $importer, $active = 'help', $plugin_k ...@@ -349,7 +350,7 @@ function feeds_ui_edit_page(FeedsImporter $importer, $active = 'help', $plugin_k
$config_info[] = $info; $config_info[] = $info;
// Fetcher. // Fetcher.
$fetcher = $plugins[$config['fetcher']['plugin_key']]; $fetcher = isset($plugins[$config['fetcher']['plugin_key']]) ? $plugins[$config['fetcher']['plugin_key']] : $plugins['FeedsMissingPlugin'];
$actions = array(); $actions = array();
if ($importer->fetcher->hasConfigForm()) { if ($importer->fetcher->hasConfigForm()) {
$actions = array(l(t('Settings'), $path . '/settings/' . $config['fetcher']['plugin_key'])); $actions = array(l(t('Settings'), $path . '/settings/' . $config['fetcher']['plugin_key']));
...@@ -366,7 +367,7 @@ function feeds_ui_edit_page(FeedsImporter $importer, $active = 'help', $plugin_k ...@@ -366,7 +367,7 @@ function feeds_ui_edit_page(FeedsImporter $importer, $active = 'help', $plugin_k
$config_info[] = $info; $config_info[] = $info;
// Parser. // Parser.
$parser = $plugins[$config['parser']['plugin_key']]; $parser = isset($plugins[$config['parser']['plugin_key']]) ? $plugins[$config['parser']['plugin_key']] : $plugins['FeedsMissingPlugin'];
$actions = array(); $actions = array();
if ($importer->parser->hasConfigForm()) { if ($importer->parser->hasConfigForm()) {
$actions = array(l(t('Settings'), $path . '/settings/' . $config['parser']['plugin_key'])); $actions = array(l(t('Settings'), $path . '/settings/' . $config['parser']['plugin_key']));
...@@ -383,7 +384,7 @@ function feeds_ui_edit_page(FeedsImporter $importer, $active = 'help', $plugin_k ...@@ -383,7 +384,7 @@ function feeds_ui_edit_page(FeedsImporter $importer, $active = 'help', $plugin_k
$config_info[] = $info; $config_info[] = $info;
// Processor. // Processor.
$processor = $plugins[$config['processor']['plugin_key']]; $processor = isset($plugins[$config['processor']['plugin_key']]) ? $plugins[$config['processor']['plugin_key']] : $plugins['FeedsMissingPlugin'];
$actions = array(); $actions = array();
if ($importer->processor->hasConfigForm()) { if ($importer->processor->hasConfigForm()) {
$actions[] = l(t('Settings'), $path . '/settings/' . $config['processor']['plugin_key']); $actions[] = l(t('Settings'), $path . '/settings/' . $config['processor']['plugin_key']);
......
...@@ -272,9 +272,78 @@ class FeedsMissingPlugin extends FeedsPlugin { ...@@ -272,9 +272,78 @@ class FeedsMissingPlugin extends FeedsPlugin {
public function pluginType() { public function pluginType() {
return 'missing'; return 'missing';
} }
public function save() {}
/**
* Fetcher methods.
*/
public function fetch(FeedsSource $source) {
return new FeedsFetcherResult('');
}
public function clear(FeedsSource $source) {}
public function request($feed_nid = 0) {
drupal_access_denied();
}
public function menuItem() { public function menuItem() {
return array(); return array();
} }
public function subscribe(FeedsSource $source) {}
public function unsubscribe(FeedsSource $source) {}
public function importPeriod(FeedsSource $source) {}
/**
* Parser methods.
*/
public function parse(FeedsSource $source, FeedsFetcherResult $fetcher_result) {
return new FeedsParserResult();
}
public function getMappingSources() {
return array();
}
/**
* Processor methods.
*/
public function process(FeedsSource $source, FeedsParserResult $parser_result) {}
public function entityType() {}
public function bundle() {}
public function bundleOptions() {
return array();
}
public function getLimit() {
return 0;
}
public function getMappings() {
return array();
}
public function getMappingTargets() {
return array();
}
public function expire(FeedsSource $source, $time = NULL) {}
public function itemCount(FeedsSource $source) {
return 0;
}
public function expiryTime() {
return FEEDS_EXPIRE_NEVER;
}
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment