Follow-up for: #2157785: Deploy_7 code lacks functionality from D6 code.

Below is a first stab at core to get a list of all text fields, in order to rewrite URI's in its db columns.

  $field_list = field_info_field_map();
  // Remove all non text fields from the list
  foreach ($field_listmap as $key => $info) {
    $tablekey = check_plain($key); // TODO better filter?
    if ($info['type'] == 'text_with_summary') {
      db_query("UPDATE {field_data_$tablekey} SET ${tablekey}_summary     = REPLACE(${tablekey}_summary, :old, :new)", $replace_patterns);
      db_query("UPDATE {field_revision_${tablekey}} SET ${tablekey}_summary = REPLACE(${tablekey}_summary, :old, :new)", $replace_patterns);
    }

    if (in_array($info['type'], array('text_long', 'text_with_summary'))) {
      db_query("UPDATE {field_data_$tablekey} SET ${tablekey}_value       = REPLACE(${tablekey}_value,   :old, :new)", $replace_patterns);
      db_query("UPDATE {field_revision_${tablekey}} SET ${tablekey}_value   = REPLACE(${tablekey}_value,   :old, :new)", $replace_patterns);
    }
  }

Comments

helmo’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

omega8cc’s picture

Category: Feature request » Bug report
Priority: Minor » Critical
Status: Closed (fixed) » Needs work

This breaks support for ancient D7 versions, like 7.14 and we are not expected to not support 7.14 just because it is very old.

Drush command terminated abnormally due to an unrecoverable error. Error: 
Call to undefined function field_info_field_map() in 
/data/disk/o1/.drush/sys/provision/platform/drupal/deploy_7.inc, 
line 47

field_info_field_map() exists in the field module (field.info.inc) in later versions of Drupal, but not in Drupal 7.14.

omega8cc’s picture

We should wrap this within:

if (function_exists('field_info_field_map')) {
// here
}

  • omega8cc committed dffa256 on 6.x-2.x
    Issue #2163979 - Check if field_info_field_map() is available to not...

  • omega8cc committed 5687847 on 7.x-3.x
    Issue #2163979 - Check if field_info_field_map() is available to not...
omega8cc’s picture

Status: Needs work » Fixed

Fixed.

Status: Fixed » Closed (fixed)

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