diff --git a/core/modules/locale/src/StringDatabaseStorage.php b/core/modules/locale/src/StringDatabaseStorage.php index 058c689..ff45957 100644 --- a/core/modules/locale/src/StringDatabaseStorage.php +++ b/core/modules/locale/src/StringDatabaseStorage.php @@ -2,6 +2,7 @@ namespace Drupal\locale; +use Drupal\Component\Utility\Unicode; use Drupal\Core\Database\Connection; /** @@ -462,6 +463,14 @@ protected function dbStringSelect(array $conditions, array $options = array()) { * If the string is not suitable for this storage, an exception is thrown. */ protected function dbStringInsert($string) { + // Issue #1885192: Field locales_source.source is not suitable for long + // texts and huge config objects. + // + // Work-around: Don't save strings that are greater the 64kb. + if (Unicode::strlen($string->getString()) > 64000) { + $string->setString(''); + } + if ($string->isSource()) { $string->setValues(array('context' => '', 'version' => 'none'), FALSE); $fields = $string->getValues(array('source', 'context', 'version'));