backdrop-contrib / feeds_tamper

Feeds Tamper provides a small plugin architecture for Feeds to modify data before it gets saved.
GNU General Public License v2.0
0 stars 2 forks source link

"Call to undefined function feeds_tamper_explode_validate()" #3

Closed ghost closed 4 years ago

ghost commented 4 years ago

On trying to add an 'explode' tamper, I get this error:

Call to undefined function feeds_tamper_explode_validate()

This seems to be a result of moving code around in the module (in D7 the call to this function was in the same file as the function, whereas in Backdrop it's been separated into different files). I think a simple 'include' is needed, but I'm guessing a lot of them will be needed as it looks like this might affect all plugins, not just the 'explode' one...

ghost commented 4 years ago

Since they're not used, replacing these lines:

$path = 'plugins/';
$module = 'feeds_tamper';

in feeds_tamper.plugins.inc with:

$plugins = backdrop_get_path('module', 'feeds_tamper') . '/plugins/*.inc';
foreach (glob($plugins) as $plugin) {
  include_once $plugin;
}

seems to work. Not sure if that's the best solution though...

herbdool commented 4 years ago

Oops, I had only checked the callback.

I don't want to do an include here since it's supposed to be plugable. We'll need to include once it's gathered all the info hooks data.

herbdool commented 4 years ago

I've pushed a fix for that.

My approach has been for each info hook to define the path and file so we can include it wherever we gather up all the plugins. A different approach from what you describe above which requires a particular directory.