When using the module on a PHP7 installation, it fails to install with the following error:

Fatal error: Redefinition of parameter $source in [...]/sites/all/modules/feeds_tamper/plugins/default_value.inc on line 36

Since that parameter is not even used in the function, the obvious solution would just be to remove or rename it.

function feeds_tamper_default_value_callback($source, $item_key, $element_key, &$field, $settings, $source) {
  // Setting a default value.
  if (!empty($settings['only_if_empty']) && !$field) {
    $field = $settings['default_value'];
  }
  elseif (empty($settings['only_if_empty'])) {
    $field = $settings['default_value'];
  }
}

Perhaps should be:

function feeds_tamper_default_value_callback($source, $item_key, $element_key, &$field, $settings) {
  // Setting a default value.
  if (!empty($settings['only_if_empty']) && !$field) {
    $field = $settings['default_value'];
  }
  elseif (empty($settings['only_if_empty'])) {
    $field = $settings['default_value'];
  }
}

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

orphans created an issue. See original summary.

Znak’s picture

Assigned: Unassigned » Znak
Znak’s picture

Status: Active » Needs review
FileSize
622 bytes

Patch for this problems. Please, check up

Status: Needs review » Needs work

The last submitted patch, 3: module_fails_with_fatal_error-2848365-3.patch, failed testing.

geekygnr’s picture

Status: Needs work » Closed (duplicate)

there is a commit from issue #2567431 that fixes this issue already.

geekygnr’s picture

geekygnr’s picture

hairidine’s picture

PHP Fatal error: Redefinition of parameter $source in /home/xxxx/git/creativity/creativity/modules/contrib/feeds_tamper/plugins/default_value.inc on line 36