Skip to content

Commit 9495ec2

Browse files
authored
Merge pull request #3491 from obsidian-tasks-group/obsidain-1.9.2
docs: Write up observations on Obsidian 1.9.x property reading
2 parents a29e7f9 + 71de8b3 commit 9495ec2

17 files changed

+474
-25
lines changed

docs/Support and Help/About Support and Help.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ publish: true
1111
### User Support
1212

1313
- [[Known Limitations]]
14+
- [[Missing tags, aliases and cssclasses in Obsidian some 1.9.x versions]]
15+
- This page is for all Obsidian 1.9.x Insider users - not just Tasks users - to find and fix properties values that Obsidian 1.9.x no longer recognised.
1416
- [[Missing tasks in callouts with some Obsidian 1.6.x versions]]
1517
- Use Obsidian 1.6.5 or newer to fix potential missed tasks in your vaults.
1618
- [[Report a Bug]]
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
---
2+
publish: true
3+
---
4+
5+
# Missing tags, aliases and cssclasses in Obsidian some 1.9.x versions
6+
7+
## Obsidian 1.9.0 reads properties strictly
8+
9+
> [!Warning] Warning: Breaking changes in Obsidian 1.9.x
10+
>
11+
> The [Bases](https://help.obsidian.md/bases) functionality in Obsidian 1.9.x is amazing.
12+
>
13+
> However, it is important to note the following in the [Obsidian 1.9.0 (Insider) changelog](https://obsidian.md/changelog/2025-05-21-desktop-v1.9.0/):
14+
> > [!Quote] Breaking changes
15+
> > We have officially removed support for the properties `tag`, `alias`, `cssclass` in favor of `tags`, `aliases` and `cssclasses`. In addition, the values of these properties _must_ be a list. If the current value is a text property, it will no longer be recognized by Obsidian.
16+
17+
## Things discovered whilst exploring this breaking change
18+
19+
All the following were observed and tested in Obsidian 1.9.2.
20+
21+
1. Any properties called `tag`, `alias`, or `cssclass` are now ignored by Obsidian.
22+
2. Obsidian no longer warns about incorrectly-formatted `tags`, `aliases` and `cssclasses` values, so they are easy to miss.
23+
3. Any `tags`, `aliases` and `cssclasses` properties with non-list (incorrectly formatter) values will have their values deleted if Obsidian makes any changes to the file's frontmatter.
24+
4. Obsidian does still support capitalised versions of the correctly spelled names: `TAGS`, `ALIASES` AND `CSSCLASSES`.
25+
26+
### You should check and fix your vault before using the 'File Properties' UI to edit any properties
27+
28+
Editing _any_ properties using **File Properties** or any other Obsidian properties editing UI causes Obsidian to delete text values for `tags`, `aliases` and `cssclasses`.
29+
30+
Unless you have version-controlled your vault, and you regularly check for differences, it's very possible your vault will lose values that previously were read.
31+
32+
The following sections show how you can fix and fix most of the problem cases.
33+
34+
### Find and rename old `tag`, `alias`, `cssclass` and properties
35+
36+
You will need to find all uses of the `tag`, `alias`, `cssclass` properties and manually rename them to `tags`, `aliases` and `cssclasses`, to ensure that Obsidian files these properties, as it did prior to version 1.9.0.
37+
38+
There doesn't seem to be a way to use [bases](https://help.obsidian.md/bases) to find these values.
39+
40+
So here is one way to do this.
41+
42+
> [!Tip]
43+
> For maximum safety, you will need to be sure you edit the **Source** of the properties.
44+
>
45+
> - (Temporarily) Change your Obsidian **Editing settings** to:
46+
> - Properties in document: **Source**
47+
48+
Steps:
49+
50+
1. In the Obsidian **Search** box, paste in `["alias"]`.
51+
- If any values are found, click on each file, and **edit the property name to `aliases`**.
52+
2. In the Obsidian **Search** box, paste in `["tag"]`.
53+
- If any values are found, click on each file, and **edit the property name to `tags`**.
54+
3. In the Obsidian **Search** box, paste in `["cssclass"]`.
55+
- If any values are found, click on each file, and **edit the property name to `cssclasses`**.
56+
57+
### Find and fix the type of `tags`, `aliases` and `cssclasses` with string values
58+
59+
`tags`, `aliases` and `cssclasses` properties with string values will be discarded if you use Obsidian's UI to edit any properties in those files.
60+
61+
Here is one way to fix them.
62+
63+
1. Download the file **[Check Tags.base](https://github.com/obsidian-tasks-group/obsidian-tasks/tree/main/resources/sample_vaults/Tasks-Demo/How%20To/Find%20properties%20not%20read%20by%20Obsidian%201.9.x)** - and open it in Obsidian 1.9.2 or newer.
64+
- Pin the file
65+
- Review _all_ the values in the **ErrorsAreTagsValuesNeedingFixing** column.
66+
- For every row that has an **⚠︎ Error** value:
67+
- Click on the file name
68+
- Put a `[` at the **start** of the **values** in the **tags** line
69+
- Put a `]` at the **end** of the **values** in the **tags** line
70+
- For example, change this:
71+
72+
```yaml
73+
---
74+
tags: value-1-of-2-on-one-line, value-2-of-2-on-one-line
75+
---
76+
```
77+
78+
- To this:
79+
80+
```yaml
81+
---
82+
tags: [value-1-of-2-on-one-line, value-2-of-2-on-one-line]
83+
---
84+
```
85+
86+
2. Download the file **[Check Aliases.base](https://github.com/obsidian-tasks-group/obsidian-tasks/tree/main/resources/sample_vaults/Tasks-Demo/How%20To/Find%20properties%20not%20read%20by%20Obsidian%201.9.x)** - and open it in Obsidian 1.9.2 or newer.
87+
- Pin the file
88+
- Review _all_ the values in the **ErrorsAreAliasesValuesNeedingFixing** column.
89+
- For every row that has an **⚠︎ Error** value:
90+
- Click on the file name
91+
- Put a `[` at the **start** of the **values** in the **aliases** line
92+
- Put a `]` at the **end** of the **values** in the **aliases** line
93+
- For example, change this:
94+
95+
```yaml
96+
---
97+
aliases: value-1-of-2-on-one-line, value-2-of-2-on-one-line
98+
---
99+
```
100+
101+
- To this:
102+
103+
```yaml
104+
---
105+
aliases: [value-1-of-2-on-one-line, value-2-of-2-on-one-line]
106+
---
107+
```
108+
109+
3. Download the file **[Check CssClasses.base](https://github.com/obsidian-tasks-group/obsidian-tasks/tree/main/resources/sample_vaults/Tasks-Demo/How%20To/Find%20properties%20not%20read%20by%20Obsidian%201.9.x)** - and open it in Obsidian 1.9.2 or newer.
110+
- Pin the file
111+
- Review _all_ the values in the **ErrorsAreCssclassesValuesNeedingFixing** column.
112+
- For every row that has an **⚠︎ Error** value:
113+
- Click on the file name
114+
- Put a `[` at the **start** of the **values** in the **cssclasses** line
115+
- Put a `]` at the **end** of the **values** in the **cssclasses** line
116+
- For example, change this:
117+
118+
```yaml
119+
---
120+
cssclasses: value-1-of-2-on-one-line, value-2-of-2-on-one-line
121+
---
122+
```
123+
124+
- To this:
125+
126+
```yaml
127+
---
128+
cssclasses: [value-1-of-2-on-one-line, value-2-of-2-on-one-line]
129+
---
130+
```

docs/What is New/Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ _In recent [Tasks releases](https://github.com/obsidian-tasks-group/obsidian-tas
1313
## 7.x releases
1414

1515
- X.Y.Z:
16+
- [[Missing tags, aliases and cssclasses in Obsidian some 1.9.x versions]] - for Insider users of Obsidian 1.9.x.
1617
- [[Line Continuations]] can now be used in the [[Query File Defaults]] property `TQ_extra_instructions`.
1718
- [[Check your Statuses]] report now contains samples of each status, and a convenient search to test them.
1819
- Add German translation of [[Settings]], [[Editing a Status]] and [[Check your Statuses]].
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
filters:
2+
or:
3+
- "!aliases.isEmpty()"
4+
formulas:
5+
ErrorsAreAliasesValuesNeedingFixing: note.aliases.join("; ")
6+
views:
7+
- type: table
8+
name: Table
9+
order:
10+
- file.name
11+
- formula.ErrorsAreAliasesValuesNeedingFixing
12+
- aliases
13+
- file.path
14+
sort:
15+
- column: file.path
16+
direction: ASC
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
filters:
2+
or:
3+
- "!cssclasses.isEmpty()"
4+
formulas:
5+
ErrorsAreCssclassesValuesNeedingFixing: note.cssclasses.join("; ")
6+
views:
7+
- type: table
8+
name: Table
9+
order:
10+
- file.name
11+
- formula.ErrorsAreCssclassesValuesNeedingFixing
12+
- cssclasses
13+
- file.path
14+
sort:
15+
- column: file.path
16+
direction: ASC
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
filters:
2+
or:
3+
- "!tags.isEmpty()"
4+
formulas:
5+
ErrorsAreTagsValuesNeedingFixing: note.tags.join("; ")
6+
views:
7+
- type: table
8+
name: Table
9+
order:
10+
- file.name
11+
- formula.ErrorsAreTagsValuesNeedingFixing
12+
- tags
13+
- file.path
14+
sort:
15+
- column: file.path
16+
direction: ASC
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
aliases: value-1-of-2-on-one-line, value-2-of-2-on-one-line
3+
---
4+
5+
# yaml_aliases_with_two_values_on_one_line
6+
7+
- [ ] #task Task in 'yaml_aliases_with_two_values_on_one_line'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
cssclasses: value-1-of-2-on-one-line, value-2-of-2-on-one-line
3+
---
4+
5+
# yaml_cssclasses_with_two_values_on_one_line
6+
7+
- [ ] #task Task in 'yaml_cssclasses_with_two_values_on_one_line'

tests/Obsidian/AllCacheSampleData.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,13 @@ import query_file_defaults_short_mode from './__test_data__/query_file_defaults_
6666
import query_using_properties from './__test_data__/query_using_properties.json';
6767
import yaml_1_alias from './__test_data__/yaml_1_alias.json';
6868
import yaml_2_aliases from './__test_data__/yaml_2_aliases.json';
69+
import yaml_aliases_with_two_values_on_one_line from './__test_data__/yaml_aliases_with_two_values_on_one_line.json';
6970
import yaml_all_property_types_empty from './__test_data__/yaml_all_property_types_empty.json';
7071
import yaml_all_property_types_populated from './__test_data__/yaml_all_property_types_populated.json';
7172
import yaml_capitalised_property_name from './__test_data__/yaml_capitalised_property_name.json';
7273
import yaml_complex_example from './__test_data__/yaml_complex_example.json';
7374
import yaml_complex_example_standardised from './__test_data__/yaml_complex_example_standardised.json';
75+
import yaml_cssclasses_with_two_values_on_one_line from './__test_data__/yaml_cssclasses_with_two_values_on_one_line.json';
7476
import yaml_custom_number_property from './__test_data__/yaml_custom_number_property.json';
7577
import yaml_tags_field_added_by_obsidian_but_not_populated from './__test_data__/yaml_tags_field_added_by_obsidian_but_not_populated.json';
7678
import yaml_tags_had_value_then_was_emptied_by_obsidian from './__test_data__/yaml_tags_had_value_then_was_emptied_by_obsidian.json';
@@ -157,11 +159,13 @@ export function allCacheSampleData(): SimulatedFile[] {
157159
query_using_properties,
158160
yaml_1_alias,
159161
yaml_2_aliases,
162+
yaml_aliases_with_two_values_on_one_line,
160163
yaml_all_property_types_empty,
161164
yaml_all_property_types_populated,
162165
yaml_capitalised_property_name,
163166
yaml_complex_example,
164167
yaml_complex_example_standardised,
168+
yaml_cssclasses_with_two_values_on_one_line,
165169
yaml_custom_number_property,
166170
yaml_tags_field_added_by_obsidian_but_not_populated,
167171
yaml_tags_had_value_then_was_emptied_by_obsidian,

tests/Obsidian/__test_data__/jason_properties.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,7 @@
121121
"fileContents": "---\n{\n \"tags\": \"journal\",\n \"publish\": false\n}\n---\n\n# jason_properties\n\n- [ ] #task Task in 'jason_properties'\n",
122122
"filePath": "Test Data/jason_properties.md",
123123
"getAllTags": [
124-
"#journal",
125124
"#task"
126125
],
127-
"parseFrontMatterTags": [
128-
"#journal"
129-
]
126+
"parseFrontMatterTags": null
130127
}

0 commit comments

Comments
 (0)