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