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

Insert template not working in 1.6.6 #4339

Closed
rqkeating opened this issue Jan 11, 2021 · 3 comments
Closed

Insert template not working in 1.6.6 #4339

rqkeating opened this issue Jan 11, 2021 · 3 comments
Labels
bug It's a bug desktop All desktop platforms high High priority issues

Comments

@rqkeating
Copy link

Using the menus File/Template/Insert template or using the shortcut Ctrl+Alt+i and selecting the template does not insert anything. You can however use the create from template options to make a new note/todo.

Environment

Joplin version: 1.6.6
Platform: Linux
OS specifics: Kubuntu 20.10

Steps to reproduce

  1. create a simple .md file as a template with only one line of text in it (to keep things simple.)
  2. for Linux, save this file in ~/.config/joplin-desktop/templates
  3. Start Joplin or if it is running, select File/Templates/refresh templates.
  4. create a note
  5. open the note and put the cursor in the note
  6. select File/Templates/insert template
  7. select the template you created from the next window that appears and press ok
  8. You will see the template has not been written into the note (the note hasn't visibly changed at all.)
  9. This can be repeated using the shortcut Ctrl-Alt-i instead of going through the menus to also reproduce the problem.

Describe what you expected to happen

I expected the template to be inserted into the note as it did on the official version of Joplin prior to 1.6.6.

Logfile

Console output:
09:54:37: CommandService::execute: selectTemplate
/tmp/.mount_Joplin8e…evelopment.js:11494 Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

  • Move data fetching code or side effects to componentDidUpdate.
  • If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
  • Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run npx react-codemod rename-unsafe-lifecycles in your project source folder.

Please update the following components: Select
/tmp/.mount_Joplin8e…n/lib/Logger.js:179 09:54:42: CommandService::execute: insertText one line template for testing
/tmp/.mount_Joplin8e…mmandService.js:144 Uncaught (in promise) Error: Cannot execute a command without a runtime: insertText
at CommandService. (/tmp/.mount_Joplin8e…mmandService.js:144)
at Generator.next ()
at /tmp/.mount_Joplin8e…CommandService.js:8
at new Promise ()
at __awaiter (/tmp/.mount_Joplin8e…CommandService.js:4)
at CommandService.execute (/tmp/.mount_Joplin8e…mmandService.js:136)
at /tmp/.mount_Joplin8e…electTemplate.js:34
at Generator.next ()
at /tmp/.mount_Joplin8e…selectTemplate.js:8
at new Promise ()

​log.txt output:
021-01-11 09:54:37: "CommandService::execute:", "selectTemplate", "[]"
2021-01-11 09:54:42: "CommandService::execute:", "insertText", "["one line template for testing\n"]"

@rqkeating rqkeating added the bug It's a bug label Jan 11, 2021
@laurent22 laurent22 added desktop All desktop platforms high High priority issues labels Jan 11, 2021
@laurent22
Copy link
Owner

@CalebJohn, this bug was introduced by this pull request: #4303 but I'm not sure exactly how. As you've changed the way some commands are declared I guess some of them are being skipped, when they shouldn't. Do you know what might be the issue? If it's tricky to find a fix, is it ok to revert the pull request, or would that introduce another bug (since that pull request was meant to fix something)?

@laurent22
Copy link
Owner

Added a comment where the issue might be: https://github.com/laurent22/joplin/pull/4303/files#r555277583

@CalebJohn
Copy link
Collaborator

Fixes by #4343

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug desktop All desktop platforms high High priority issues
Projects
None yet
Development

No branches or pull requests

3 participants