Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By MegaChriz on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
7.x-2.x
Introduced in version:
7.x-2.0-beta1
Issue links:
Description:
With form and summary callbacks for a target, you can supply additional configuration options for your target. The form callbacks are used to provide a form to set the target configuration and the summary callbacks are used to display this configuration.
Two aspects have been changed regarding defining these callbacks:
- The definition names were changed. Use
form_callbacks
andsummary_callbacks
instead ofform_callback
andsummary_callback
(note that an additional "s" is added to the definition names). - Instead of one, multiple form and summary callbacks can now be defined. These should now be defined in an array instead of a string.
The old way of defining form and summary callbacks is still supported, but discouraged.
Before:
/**
* Implements hook_feeds_processor_targets().
*/
function my_module_feeds_processor_targets($entity_type, $bundle) {
$targets['my_target'] = array(
'name' => t('My target'),
'description' => t('A target with additional configuration.'),
'callback' => 'my_module_set_target',
'form_callback' => 'my_module_form_callback',
'summary_callback' => 'my_module_summary_callback',
);
}
After:
/**
* Implements hook_feeds_processor_targets().
*/
function my_module_feeds_processor_targets($entity_type, $bundle) {
$targets['my_target'] = array(
'name' => t('My target'),
'description' => t('A target with additional configuration.'),
'callback' => 'my_module_set_target',
'form_callbacks' => array('my_module_form_callback'),
'summary_callbacks' => array('my_module_summary_callback'),
);
}
Impacts:
Module developers