SebastianMC / obsidian-custom-sort

Take full control over the order and sorting of folders and notes in File Explorer in Obsidian
GNU General Public License v3.0
302 stars 23 forks source link

[bug][minor] Obsidian 1.7.2 breaking changes - when File Explorer is not displayed an attempt to apply custom sort fails with error #162

Open SebastianMC opened 2 months ago

SebastianMC commented 2 months ago

When a vault is (re)loaded and the File Explorer view is not shown (e.g. some other view in the pane is active) an attempt to apply custom sort fails with error visible in console.

This is because of the new breaking change in Obsidian 1.7.2 referred to as 'deferred views' (https://docs.obsidian.md/Plugins/Guides/Understanding+deferred+views)

After showing the File Explorer view the custom sorting can be applied (manually via command or ribbon icon) without any problems

BTW this breaking change in Obsidian also affects some other plugins, like Folder Notes (errors visible in console). To be able to use the Folder Notes normally, you need to activate the File Explorer and force reload the vault or re-enable the plugin. Introducing breaking changes (more and more often) and not maintaining backward compatibility is a way to kill the plugin community long term... I understand the technical reasons behind Obsidian evolution, internal improvements, refactoring. At the same time doing this without keeping the backward compatibility is IMO contradictory to what is stated on obsidian.md: "With hundreds of plugins [...]".

Solution for this seems to be simple: