Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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
Comment #1
helmo CreditAttribution: helmo commentedFixed together with #2157785: Deploy_7 code lacks functionality from D6 code.
Comment #3
omega8cc CreditAttribution: omega8cc commentedThis 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.
field_info_field_map()
exists in the field module (field.info.inc) in later versions of Drupal, but not in Drupal 7.14.Comment #4
omega8cc CreditAttribution: omega8cc commentedWe should wrap this within:
Comment #7
omega8cc CreditAttribution: omega8cc commentedFixed.