From a966aba46216e719e438fbf19565c1d540035b5e Mon Sep 17 00:00:00 2001 From: diamondsea <diamondsea@430714.no-reply.drupal.org> Date: Tue, 29 Mar 2016 10:31:29 +0200 Subject: [PATCH] Issue #2367829 by MegaChriz, diamondsea: Added descriptions for options for "Update existing" setting. --- plugins/FeedsProcessor.inc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/plugins/FeedsProcessor.inc b/plugins/FeedsProcessor.inc index a77a284e..d2d13dd0 100644 --- a/plugins/FeedsProcessor.inc +++ b/plugins/FeedsProcessor.inc @@ -883,14 +883,15 @@ abstract class FeedsProcessor extends FeedsPlugin { $form['update_existing'] = array( '#type' => 'radios', '#title' => t('Update existing @entities', $tokens), - '#description' => - t('Existing @entities will be determined using mappings that are a "unique target".', $tokens), + '#description' => t('Existing @entities will be determined using mappings that are a "unique target".', $tokens), '#options' => array( FEEDS_SKIP_EXISTING => t('Do not update existing @entities', $tokens), FEEDS_REPLACE_EXISTING => t('Replace existing @entities', $tokens), FEEDS_UPDATE_EXISTING => t('Update existing @entities', $tokens), ), '#default_value' => $this->config['update_existing'], + '#after_build' => array('feeds_processor_config_form_update_existing_after_build'), + '#tokens' => $tokens, ); global $user; $formats = filter_formats($user); @@ -1292,3 +1293,14 @@ abstract class FeedsProcessor extends FeedsPlugin { } class FeedsProcessorBundleNotDefined extends Exception {} + +/** + * Form after build callback for the field "update_existing". + * + * Adds descriptions to options of this field. + */ +function feeds_processor_config_form_update_existing_after_build($field) { + $field[FEEDS_REPLACE_EXISTING]['#description'] = t('Loads records directly from the database, bypassing the Entity API. Faster, but use with caution.'); + $field[FEEDS_UPDATE_EXISTING]['#description'] = t('Loads complete @entities using the Entity API for full integration with other modules. Slower, but most reliable.', $field['#tokens']); + return $field; +} -- GitLab