diff --git a/tests/feeds_tests.module b/tests/feeds_tests.module index 8d3a1db..99f4df3 100644 --- a/tests/feeds_tests.module +++ b/tests/feeds_tests.module @@ -121,7 +121,7 @@ function feeds_tests_feeds_processor_targets($entity_type, $bundle) { 'callback' => 'feeds_tests_mapper_set_target', 'summary_callbacks' => array('feeds_tests_mapper_summary'), 'form_callbacks' => array('feeds_tests_mapper_form'), - 'preprocess_callbacks' => array('feeds_tests_preprocess_callback'), + 'preprocess_callbacks' => array(array(new FeedsTestsPreprocess(), 'callback')), ); $targets['test_unique_target'] = array( @@ -130,7 +130,7 @@ function feeds_tests_feeds_processor_targets($entity_type, $bundle) { 'callback' => 'feeds_tests_mapper_set_target', 'optional_unique' => TRUE, 'unique_callbacks' => array('feeds_tests_mapper_unique'), - 'preprocess_callbacks' => array('feeds_tests_preprocess_callback'), + 'preprocess_callbacks' => array(array('FeedsTestsPreprocess', 'callback')), ); return $targets; @@ -269,3 +269,19 @@ function feeds_tests_mapper_unique(FeedsSource $source, $entity_type, $bundle, $ return key($result[$entity_type]); } } + +/** + * Helper class to ensure callbacks can be objects. + */ +class FeedsTestsPreprocess { + +/** + * Preprocess callback for test_target. + * + * @see feeds_tests_feeds_processor_targets() + */ + public static function callback(FeedsSource $source, $target_item, $target, array &$mapping) { + $mapping['required_value'] = TRUE; + } + +}