fix(netlify-cms-core): files collection blank label (#1987)
This commit is contained in:
parent
b1e490dce5
commit
f2e4800989
@ -300,13 +300,14 @@ class Backend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getEntry(collection, slug) {
|
getEntry(collection, slug) {
|
||||||
return this.implementation
|
const path = selectEntryPath(collection, slug);
|
||||||
.getEntry(collection, slug, selectEntryPath(collection, slug))
|
const files = collection.get('files');
|
||||||
.then(loadedEntry =>
|
const label = files && files.find(f => f.get('file') === path).get('label');
|
||||||
|
return this.implementation.getEntry(collection, slug, path).then(loadedEntry =>
|
||||||
this.entryWithFormat(collection, slug)(
|
this.entryWithFormat(collection, slug)(
|
||||||
createEntry(collection.get('name'), slug, loadedEntry.file.path, {
|
createEntry(collection.get('name'), slug, loadedEntry.file.path, {
|
||||||
raw: loadedEntry.data,
|
raw: loadedEntry.data,
|
||||||
label: loadedEntry.file.label,
|
label,
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user