diff --git a/core/modules/field/modules/text/text.install b/core/modules/field/modules/text/text.install index a2ef0cf..d672cfc 100644 --- a/core/modules/field/modules/text/text.install +++ b/core/modules/field/modules/text/text.install @@ -65,3 +65,14 @@ function text_field_schema($field) { ), ); } + +/** +* Converts default_summary_length variable to config. +* +* @ingroup config_upgrade +*/ +function text_update_8001() { + update_variables_to_config('text.settings', array( + 'teaser_length' => 'default_summary_length' + )); +} diff --git a/core/modules/field/modules/text/text.module b/core/modules/field/modules/text/text.module index efb0079..7e92375 100644 --- a/core/modules/field/modules/text/text.module +++ b/core/modules/field/modules/text/text.module @@ -229,9 +229,7 @@ function _text_sanitize($instance, $langcode, $item, $column) { function text_summary($text, $format = NULL, $size = NULL) { if (!isset($size)) { - // What used to be called 'teaser' is now called 'summary', but - // the variable 'teaser_length' is preserved for backwards compatibility. - $size = variable_get('teaser_length', 600); + $size = config('text.settings')->get('default_summary_length'); } // Find where the delimiter is in the body