|
| 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 | + ``` |
0 commit comments