Commit 0a9ed3f8 authored by Dries's avatar Dries

Issue #1798880 by andyceo, LinL, mtunay: Convert teaser_length() to use configuration system.

parent 405c5fbd
......@@ -65,3 +65,14 @@ function text_field_schema($field) {
),
);
}
/**
* Moves teaser length from variable to config.
*
* @ingroup config_upgrade
*/
function text_update_8000() {
update_variables_to_config('text.settings', array(
'teaser_length' => 'default_summary_length',
));
}
......@@ -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
......
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