Commit ac135025 authored by Alex Vandiver's avatar Alex Vandiver
Browse files

When a value overflows into LargeContent, ensure that Content is null

The ->AddCustomFieldValue codepath attempts to ensure that empty values
for Content or LargeContent are never passed down the stack for
insertion.  However, this is foiled if a >255-character value is passed
through for Value, is only caught at the ObjectCustomFieldValue->Create
level -- which sets Content to the empty string when upgrading the
Content to LargeContent, rather than undef.

Ensure that NULLs are properly stored in the Content column when
LargeContent is used, by setting Content to undef in such cases.  There
may also exist historical OCFVs which contain '' instead of NULL; update
them accordingly.
parent b1d6b927
-- No update is necessary, given that '' == NULL on Oracle
UPDATE ObjectCustomFieldValues SET Content = NULL WHERE LargeContent IS NOT NULL AND Content = '';
UPDATE ObjectCustomFieldValues SET Content = NULL WHERE LargeContent IS NOT NULL AND Content = '';
......@@ -119,7 +119,7 @@ sub Create {
}
else {
$args{'LargeContent'} = $args{'Content'};
$args{'Content'} = '';
$args{'Content'} = undef;
$args{'ContentType'} ||= 'text/plain';
}
}
......
Supports Markdown
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