fix(netlify-cms-core): files collection blank label (#1987)

This commit is contained in:
Bartholomew 2019-01-10 22:25:53 +01:00 committed by Shawn Erquhart
parent b1e490dce5
commit f2e4800989

View File

@ -300,16 +300,17 @@ 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');
this.entryWithFormat(collection, slug)( return this.implementation.getEntry(collection, slug, path).then(loadedEntry =>
createEntry(collection.get('name'), slug, loadedEntry.file.path, { this.entryWithFormat(collection, slug)(
raw: loadedEntry.data, createEntry(collection.get('name'), slug, loadedEntry.file.path, {
label: loadedEntry.file.label, raw: loadedEntry.data,
}), label,
), }),
); ),
);
} }
getMedia() { getMedia() {