0
Fork 0
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:
Nazar Gargol 2019-01-29 12:12:10 +00:00
parent 8ce86313fc
commit bc90b8ec27

View file

@ -5,7 +5,10 @@ module.exports.forPost = (frame, model, attrs) => {
(frame.options.columns.includes('excerpt') && frame.options.formats && frame.options.formats.includes('plaintext'))) {
if (_.isEmpty(attrs.custom_excerpt)) {
const plaintext = model.get('plaintext');
if (plaintext) {
attrs.excerpt = plaintext.substring(0, 500);
}
} else {
attrs.excerpt = attrs.custom_excerpt;
}