Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Move tagged notes macro doesn't display folder picker #53

Open
jacklaing opened this issue Jul 17, 2021 · 9 comments
Open

[BUG] Move tagged notes macro doesn't display folder picker #53

jacklaing opened this issue Jul 17, 2021 · 9 comments
Assignees
Labels

Comments

@jacklaing
Copy link

@jacklaing jacklaing commented Jul 17, 2021

The macro for moving tagged notes to a folder is broken because once you've selected Yes/No on nested tags, the folder chooser just doesn't appear.

Additional context
I thought it might be because I had turned off the File Explorer core plugin, which has the Move Note hotkey bundled, but I tried turning it back on and it didn't fix it.

@chhoumann
Copy link
Owner

@chhoumann chhoumann commented Jul 21, 2021

Hey @jacklaing, thanks for your report!

I'm having a hard time reproducing this.
Does it give any errors? Maybe in the console?

@arumazu
Copy link

@arumazu arumazu commented Jul 25, 2021

Hi! Looks like I have similar issue. I can send you errors from my console log

C:\Users\user\knowledgebase\Scripts\move.js:23 Uncaught (in promise) TypeError: fileCache.frontmatter?.tags?.split is not a function
    at VM551 C:\Users\user\knowledgebase\Scripts\move.js:23
    at Array.forEach (<anonymous>)
    at moveFilesWithTag (VM551 C:\Users\user\knowledgebase\Scripts\move.js:11)
    at async MacroChoiceEngine.onExportIsFunction (eval at <anonymous> (app.js:1), <anonymous>:9669:23)
    at async MacroChoiceEngine.userScriptDelegator (eval at <anonymous> (app.js:1), <anonymous>:9653:17)
    at async MacroChoiceEngine.executeUserScript (eval at <anonymous> (app.js:1), <anonymous>:9648:9)
    at async MacroChoiceEngine.executeCommands (eval at <anonymous> (app.js:1), <anonymous>:9622:17)
    at async MacroChoiceEngine.run (eval at <anonymous> (app.js:1), <anonymous>:9615:9)
    at async ChoiceExecutor.onChooseMacroType (eval at <anonymous> (app.js:1), <anonymous>:12585:9)
    at async ChoiceExecutor.execute (eval at <anonymous> (app.js:1), <anonymous>:12561:17)
(anonymous) @ C:\Users\user\knowledgebase\Scripts\move.js:23
moveFilesWithTag @ C:\Users\user\knowledgebase\Scripts\move.js:11
async function (async)
callback @ VM545:12737
yS @ app.js:1
t.onChooseItem @ app.js:1
t.onChooseSuggestion @ app.js:1
t.selectSuggestion @ app.js:1
e.useSelectedItem @ app.js:1
(anonymous) @ app.js:1
e.handleKey @ app.js:1
e.onKeyEvent @ app.js:1

@arumazu
Copy link

@arumazu arumazu commented Jul 26, 2021

I tried to run this macro inside default Obsidian Help vault and it worked out properly. So, I decided to switch off all community plugins on my vault and tried again, but problem is the same, doesn't work.

@twakas
Copy link

@twakas twakas commented Aug 18, 2021

In my case, tag descriptions in YAML frontmatter like:

tags: [tag1, tag2]

or

tags:
- tag1

caused the same problem.
Worked properly after removing the above types of tags inside my vault.

@jacklaing
Copy link
Author

@jacklaing jacklaing commented Sep 4, 2021

I can confirm all of the above:

  • It worked in Help vault
  • I got the exact same console error as @arumazu
  • As with @twakas case, it was frontmatter of the format tags: [] that was causing the issue. Once I deleted the offending frontmatter the folder picker appeared properly. Luckily I don't use frontmatter and it was just an example page.

@dummifiedme
Copy link

@dummifiedme dummifiedme commented Sep 9, 2021

I was trying the plugin just now, initially the picker didn't work, but after a reload, it did.

So everything works for me now.
Just for everyone's information (I was maybe dumbo)

Copy the code using the button only :D Else it adds some spaces here and there. Messes up the code and adds additional spaces to the new file path.

image

@Pyrodusk
Copy link

@Pyrodusk Pyrodusk commented Sep 26, 2021

In my case, tag descriptions in YAML frontmatter like:

tags: [tag1, tag2]

or

tags:
- tag1

caused the same problem.
Worked properly after removing the above types of tags inside my vault.

Hi, I am having the same issue. How did you manage to transform your frontmatter tags to inline tags in you whole vault ? I've tried to find a way with Regex and VSC but without sucess...

I was also wondering if it would be possible to modify the js script to make it work with frontmatter tags ?

@Khoding
Copy link

@Khoding Khoding commented Jan 27, 2022

Update on this? still the same for me

@astutecat
Copy link

@astutecat astutecat commented Mar 10, 2022

I also have hit the same issue myself.

Developer console has the following:

VM145:23 Uncaught (in promise) TypeError: fileCache.frontmatter?.tags?.split is not a function
    at eval (eval at getUserScript (eval at <anonymous> (app.js:1)), <anonymous>:23:67)
    at Array.forEach (<anonymous>)
    at moveFilesWithTag (eval at getUserScript (eval at <anonymous> (app.js:1)), <anonymous>:11:11)
    at async MacroChoiceEngine.onExportIsFunction (eval at <anonymous> (app.js:1), <anonymous>:11649:23)
    at async MacroChoiceEngine.userScriptDelegator (eval at <anonymous> (app.js:1), <anonymous>:11632:21)
    at async MacroChoiceEngine.executeUserScript (eval at <anonymous> (app.js:1), <anonymous>:11613:9)
    at async MacroChoiceEngine.executeCommands (eval at <anonymous> (app.js:1), <anonymous>:11583:17)
    at async MacroChoiceEngine.run (eval at <anonymous> (app.js:1), <anonymous>:11576:9)
    at async ChoiceExecutor.onChooseMacroType (eval at <anonymous> (app.js:1), <anonymous>:15884:9)
    at async ChoiceExecutor.execute (eval at <anonymous> (app.js:1), <anonymous>:15860:17)
eval @ VM145:23
moveFilesWithTag @ VM145:11
async function (async)
callback @ VM105:16036
WR @ app.js:1
t.onChooseItem @ app.js:1
t.onChooseSuggestion @ app.js:1
t.selectSuggestion @ app.js:1
e.useSelectedItem @ app.js:1
(anonymous) @ app.js:1
e.handleKey @ app.js:1
e.onKeyEvent @ app.js:1
manager.ts:100 Uncaught (in promise) TypeError: Cannot read property 'undefined' of undefined
    at DataManager.setTotalStats (eval at <anonymous> (app.js:1), <anonymous>:5939:21)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:6225:34)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
8 participants