Skip to content

[BUG] applyTemplateToActiveFile does not apply tags to frontmatter if one tag is already there. #1628

Description

@birthdaydog

Describe the bug
When applying a template via the applyTemplateToActiveFile command, it will not apply a tag to the file if there is already a tag applied. this issue will happen in bottom and top mode.

To Reproduce
Steps to reproduce the behavior in Obsidian:
have a quickadd command ready that uses the applyTemplateToActiveFile function, have it initiate a template that contains a tag and some body text (in my case, a base code block is generated at the bottom of the file)

Expected behavior
template applied properly with a new tag being added in the tags section of the frontmatter, along with the body text being applied in the designated position.

Obsidian Debug Info (required for bug reports)

SYSTEM INFO:
	Obsidian version: 1.13.4
	Installer version: 1.12.7
	Operating system: #28~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul  1 15:50:57 UTC 2 7.0.0-28-generic
	Login status: logged in
	Language: en
	Catalyst license: insider
	Insider build toggle: off
	Live preview: on
	Base theme: dark
	Community theme: Obsidian gruvbox 0.2.1
	Snippets enabled: 3
	Restricted mode: off
	Plugins installed: 21
	Plugins enabled: 21
		1: Excalidraw v2.25.3
		2: Homepage v4.4.4
		3: Style Settings v1.0.9
		4: GDScript Syntax Highlighting v1.1.0
		5: Calendar v1.5.10
		6: Tasks v8.3.0
		7: Periodic Notes v0.0.17
		8: Vimrc Support v0.10.2
		9: Quick Switcher++ v6.1.6
		10: Readwise Official v3.0.3
		11: QuickAdd v2.19.1
		12: Kanban v2.0.51
		13: Templater v2.24.3
		14: Unicode Search v0.7.3
		15: VirtFolder v1.1.28
		16: Bulk Rename v0.5.2
		17: Advanced URI v2.0.0
		18: VSCode Editor v1.0.5
		19: Linter v1.32.0
		20: Wordy v1.3.1
		21: Vimium+ v0.3.0

RECOMMENDATIONS:
	Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
	Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

Environment (please complete the following information):

  • Obsidian version: [1.13.4]
  • QuickAdd version: [2.19.1]
  • Operating system: [Ubuntu]
  • Debug info: Paste output from Developer Tools (Ctrl+Shift+I or Cmd+Option+I on Mac)
  • Other plugins enabled: [List any other plugins that might be relevant]
  • Theme: Obsidian Gruvbox

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions