Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
0a9ed3f8
Commit
0a9ed3f8
authored
Nov 02, 2012
by
Dries Buytaert
Browse files
Issue
#1798880
by andyceo, LinL, mtunay: Convert teaser_length() to use configuration system.
parent
405c5fbd
Changes
3
Hide whitespace changes
Inline
Side-by-side
core/modules/field/modules/text/config/text.settings.yml
0 → 100644
View file @
0a9ed3f8
default_summary_length
:
600
core/modules/field/modules/text/text.install
View file @
0a9ed3f8
...
...
@@ -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'
,
));
}
core/modules/field/modules/text/text.module
View file @
0a9ed3f8
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment