not sure if this is a support request, feature request or bug report.

how do i import a tamper config export? (please don't say using Features.. ughh).

Comments

I'm interested in this too.

Feeds offers a hook for importing feed set ups via modules (like the example feeds import).

/**
* Implementation of hook_feeds_importer_default().
*/

Having a similar hook for importing feeds tamper plugin setups via file would allow creating self contained modules for an import with both feeds and feeds_tamper settings.

I'll look and see if there is such a hook or if one could be easily implemented.

Any update on this? It would be very useful. Here is a code snippet of a similar function in the feeds module:

assuming your feeds importer config (that you exported) is $feeds_importer:

  $importer = feeds_importer($feeds_importer->id);
  $importer->setConfig($feeds_importer->config);
  foreach (array('fetcher', 'parser', 'processor') as $type) {
    $importer->$type->setConfig($feeds_importer->config[$type]['config']);
  }
  $importer->save();

A similar API for feeds tamper would be nice.

You need to implement hook_feeds_tamper_default, like this:

<?php
function MODULENAME_feeds_tamper_default() {
}
?>

Then in order to your function be executed you should declare like this:

<?php
function MODULENAME_ctools_plugin_api($module = '', $api = '') {
    if (
$module == "feeds_tamper" && $api == "feeds_tamper_default") {
        return array(
"version" => "2");
    }
}
?>

Here you have a complete example

<?php
function dummy_module_ctools_plugin_api($module = '', $api = '') {
    if (
$module == "feeds_tamper" && $api == "feeds_tamper_default") {
        return array(
"version" => "2");
    }
}
function
dummy_module_feeds_tamper_default() {
   
/*This is the code resulting after export a feed tamper*/
   
$export = array();
   
$feeds_tamper = new stdClass();
   
$feeds_tamper->disabled = FALSE; /* Edit this to true to make a default feeds_tamper disabled initially */
   
$feeds_tamper->api_version = 2;
   
$feeds_tamper->id = 'module_publication_importer-prd_code-keyword_filter';
   
$feeds_tamper->importer = 'module_publication_importer';
   
$feeds_tamper->source = 'prd_code';
   
$feeds_tamper->plugin_id = 'keyword_filter';
   
$feeds_tamper->settings = array(
       
'words' => 'DUMMY',
       
'word_boundaries' => 0,
       
'exact' => 0,
       
'case_sensitive' => 0,
       
'invert' => 0,
       
'word_list' => array(
           
0 => 'DUMMY',
        ),
       
'regex' => FALSE,
       
'func' => 'mb_stripos',
    );
   
$feeds_tamper->weight = 0;
   
$feeds_tamper->description = 'Keyword filter';
   
$export[$feeds_tamper->id] = $feeds_tamper;
    return
$export;
}
?>

Category:Support request» Feature request
Issue summary:View changes

still no progress?