Commit 08e23380 authored by yched's avatar yched

Issue #1351880 by bdragon, yched: Fixed text 'allowed values' not always correctly imported

parent d195f1ef
......@@ -253,16 +253,13 @@ function content_migrate_extract_allowed_values($legacy_values, $field_type) {
if (!empty($legacy_values)) {
foreach (explode("\n", $legacy_values) as $value) {
$value = trim($value);
if (empty($value)) continue;
if (empty($value) && $value !== '0') continue;
if (strstr($value, '|')) {
$parts = explode('|', $value);
$allowed_values[trim($parts[0])] = trim($parts[1]);
}
elseif (is_numeric($value)) {
$allowed_values[$value] = $value;
}
else {
$allowed_values[] = $value;
$allowed_values[$value] = $value;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment