#384: Fix issue title field in sub-fields

This commit is contained in:
Elio Struyf
2022-08-10 16:09:21 +02:00
parent 2ef39cb2ed
commit ecc9c74091
3 changed files with 10 additions and 4 deletions
+1
View File
@@ -21,6 +21,7 @@
### 🐞 Fixes
- [#378](https://github.com/estruyf/vscode-front-matter/issues/378): Fix last modified update only to content in content folders
- [#384](https://github.com/estruyf/vscode-front-matter/issues/384): Fix issue `title` field in sub-fields
## [8.0.1] - 2022-07-13
+4 -1
View File
@@ -40,7 +40,10 @@ if (elm) {
tracesSampleRate: 0, // No performance tracing required
release: version || "",
environment: environment || "",
ignoreErrors: ['ResizeObserver loop limit exceeded']
ignoreErrors: [
'ResizeObserver loop limit exceeded',
"Cannot read properties of undefined (reading 'unobserve')"
]
});
}
+5 -3
View File
@@ -572,7 +572,7 @@ export class ContentType {
* @param contentType
* @param data
*/
private static async processFields(obj: IContentType | Field, titleValue: string, data: any, filePath: string) {
private static async processFields(obj: IContentType | Field, titleValue: string, data: any, filePath: string, isRoot: boolean = true): Promise<any> {
if (obj.fields) {
const dateFormat = Settings.get(SETTING_DATE_FORMAT) as string;
@@ -581,12 +581,14 @@ export class ContentType {
if (field.default) {
data[field.name] = processKnownPlaceholders(field.default, titleValue, dateFormat);
data[field.name] = await ArticleHelper.processCustomPlaceholders(data[field.name], titleValue, filePath);
} else {
} else if (isRoot) {
data[field.name] = titleValue;
} else {
data[field.name] = ""
}
} else {
if (field.type === "fields") {
data[field.name] = await this.processFields(field, titleValue, {}, filePath);
data[field.name] = await this.processFields(field, titleValue, {}, filePath, false);
} else {
const defaultValue = field.default;