From 0cc602dbe06f6c5c094ac904167e467c146268ef Mon Sep 17 00:00:00 2001 From: Chris Leppanen <chris.leppanen@gmail.com> Date: Thu, 28 Aug 2014 16:28:10 -0700 Subject: [PATCH] Issue #2307379 by twistor: Fixed Add FeedsConfigurable::hasConfigForm(). --- feeds_ui/feeds_ui.admin.inc | 6 +++--- includes/FeedsConfigurable.inc | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/feeds_ui/feeds_ui.admin.inc b/feeds_ui/feeds_ui.admin.inc index 52afd185..ce8f1ed7 100644 --- a/feeds_ui/feeds_ui.admin.inc +++ b/feeds_ui/feeds_ui.admin.inc @@ -348,7 +348,7 @@ function feeds_ui_edit_page($importer, $active = 'help', $plugin_key = '') { // Fetcher. $fetcher = $plugins[$config['fetcher']['plugin_key']]; $actions = array(); - if (feeds_get_form($importer->fetcher, 'configForm')) { + if ($importer->fetcher->hasConfigForm()) { $actions = array(l(t('Settings'), $path . '/settings/' . $config['fetcher']['plugin_key'])); } $info['title'] = t('Fetcher'); @@ -365,7 +365,7 @@ function feeds_ui_edit_page($importer, $active = 'help', $plugin_key = '') { // Parser. $parser = $plugins[$config['parser']['plugin_key']]; $actions = array(); - if (feeds_get_form($importer->parser, 'configForm')) { + if ($importer->parser->hasConfigForm()) { $actions = array(l(t('Settings'), $path . '/settings/' . $config['parser']['plugin_key'])); } $info['title'] = t('Parser'); @@ -382,7 +382,7 @@ function feeds_ui_edit_page($importer, $active = 'help', $plugin_key = '') { // Processor. $processor = $plugins[$config['processor']['plugin_key']]; $actions = array(); - if (feeds_get_form($importer->processor, 'configForm')) { + if ($importer->processor->hasConfigForm()) { $actions[] = l(t('Settings'), $path . '/settings/' . $config['processor']['plugin_key']); } $actions[] = l(t('Mapping'), $path . '/mapping'); diff --git a/includes/FeedsConfigurable.inc b/includes/FeedsConfigurable.inc index 05300135..2370cc41 100644 --- a/includes/FeedsConfigurable.inc +++ b/includes/FeedsConfigurable.inc @@ -169,6 +169,17 @@ abstract class FeedsConfigurable { return array(); } + /** + * Returns whether or not the configurable has a config form. + * + * @return bool + * True if the configurable has a config form, and false if not. + */ + public function hasConfigForm() { + $form_state = array(); + return (bool) $this->configForm($form_state); + } + /** * Return configuration form for this object. The keys of the configuration * form must match the keys of the array returned by configDefaults(). -- GitLab