Fatal error: Function name must be a string in /home/u5444/domains/realestate.u7394.shiva.vps-private.net/sites/all/modules/feeds_tamper/feeds_tamper.module on line 67

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dgastudio’s picture

en drupal errors log:

Notice: Undefined index: in feeds_tamper_feeds_after_parse() (line 55 of /home/u5444/domains/realestate.u7394.shiva.vps-private.net/sites/all/modules/feeds_tamper/feeds_tamper.module).

vikfroberg’s picture

Got the same problem.

dread33’s picture

Just had the same problem. For me it turned out to be a missing custom plugin .inc file in the plugin directory. I replaced the file and it's working again.

codesmith’s picture

Had same problem and same solution as #3. Upgrading feeds_tamper removed my custom plugin.

thedavidmeister’s picture

Status: Active » Needs review
FileSize
1.44 KB

I'm having the same trouble. For me $plugin is NULL so at this point I'm not even sure what is causing the issue, I've run in to similar problems in different ways over the past couple of years.

Here's a patch that makes feeds_tamper a bit more defensive in this regard - it will just skip any plugin that doesn't define a valid callback rather than trigger a fatal error.

Status: Needs review » Needs work

The last submitted patch, 1836372-5.patch, failed testing.

twistor’s picture

Yeah, I guess we could do that.

I would rather see a more helpful exception about the name of the plugin that's gone bad.

Either way, it should happen sooner in that function. There's no need to call function_exists() for every feed element.

rcodina’s picture

Issue summary: View changes

I also reproduced this error on 7.x-1.0-beta5 (I just upgraded from 7.x-1.0-beta4) To solve the issue I added two watchdog lines and I found out that I had a tamper for a field that had no plugin specified (the missing plugin name was "Required field"). So I deleted the tamper for that field and created it again. Problem gone!

To find out the problem I added this two lines of watchdog:

$plugin = $plugins[$instance->plugin_id];
watchdog('feeds_tamper',print_r($instance,true));
watchdog('feeds_tamper',print_r($plugin,true));
rcodina’s picture

A possible solution for this issue would be adding a simple "if" checking if "instance->plugin_id" is set and is not empty:

if(isset($instance->plugin_id) && !empty($instance->plugin_id)) {

          $plugin = $plugins[$instance->plugin_id];

          if ($is_array && $plugin['multi'] == 'loop') {
            foreach ($result->items[$item_key][$element_key] as &$i) {
              //plugin call as it is now
            }
          }
          elseif ($is_array && $plugin['multi'] == 'direct') {
            //plugin call as it is now
          }
          elseif (!$is_array && $plugin['single'] != 'skip') {
            //plugin call as it is now
          }
}
Leeteq’s picture

Version: 7.x-1.0-beta4 » 7.x-1.x-dev
twistor’s picture

Status: Needs work » Needs review
FileSize
984 bytes

Let's see if this works.

  • twistor committed dbf79f0 on 7.x-1.x
    Issue #1836372 by twistor, thedavidmeister | kervi: Fixed can't start...
twistor’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.