mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
🐛 Fixed plaintext attribute error when it is empty
refs #10388
- Issue was caused by migration of empty strings to null 0edacf3fc1
This commit is contained in:
parent
8ce86313fc
commit
bc90b8ec27
1 changed files with 4 additions and 1 deletions
|
@ -5,7 +5,10 @@ module.exports.forPost = (frame, model, attrs) => {
|
||||||
(frame.options.columns.includes('excerpt') && frame.options.formats && frame.options.formats.includes('plaintext'))) {
|
(frame.options.columns.includes('excerpt') && frame.options.formats && frame.options.formats.includes('plaintext'))) {
|
||||||
if (_.isEmpty(attrs.custom_excerpt)) {
|
if (_.isEmpty(attrs.custom_excerpt)) {
|
||||||
const plaintext = model.get('plaintext');
|
const plaintext = model.get('plaintext');
|
||||||
attrs.excerpt = plaintext.substring(0, 500);
|
|
||||||
|
if (plaintext) {
|
||||||
|
attrs.excerpt = plaintext.substring(0, 500);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
attrs.excerpt = attrs.custom_excerpt;
|
attrs.excerpt = attrs.custom_excerpt;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue