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: Since v0.10.0, I can't duplicate and/or import templates. #261

Open
SamejSpenser opened this issue Dec 14, 2024 · 0 comments
Open

BUG: Since v0.10.0, I can't duplicate and/or import templates. #261

SamejSpenser opened this issue Dec 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@SamejSpenser
Copy link

  • OS: ArcoLinux (Arch Linux base)
  • Browsers: Firefox, LibreWolf, Microsoft Edge and Brave Browser
  • Web Clipper version: v0.10.5
  • Obsidian version: v1.7.7

Since v0.10.0, I can't duplicate and/or import templates.

I've been waiting for a fix for this, and I haven't seen anyone mention it (I might've missed it since English isn't my first language).

I DON'T use Obsidian's native properties system (because it's totally different from the standard I've been using for over a decade), so it's super important for me to be able to duplicate and/or import existing templates to make creating new ones easier.

Here are two screenshots of the message I get when I try to duplicate a template:

LibreWolf (based on Firefox):

Screenshot in LibreWolf

Microsoft Edge (based on Chrome):

Screenshot in Microsoft Edge

Expected behavior

Use the duplicate and import function to duplicate an existing template and/or import an edited template from another browser on a different occasion to update the current templates or add new templates to the existing ones.

URLs where the bug occurs

Doesn't apply; the bug happens in the settings window of the web clipper itself!

To reproduce

Steps to reproduce the behavior:

  • To duplicate:

    1. Select the template from the list in the left column;
    2. Click the "More" button;
    3. Click "Duplicate";
    4. I get a message saying: "Failed to duplicate template. Please try again."
  • To import:

    1. Click "Import";
    2. Navigate to the directory containing the template's json file;
    3. Select the file and upload it;
    4. I get the error message on import: "Error importing template. Please check the file and try again," as shown in the screenshot below.

• Screenshot of the attempt to import a template:

Screenshot of the template import failure

The same error happens if I paste the content of the json file into the corresponding field during the import.

Your template file

This is the template I want to duplicate but I'm not able to:

{
  "schemaVersion": "0.1.0",
  "name": "Wikiwand",
  "behavior": "create",
  "noteContentFormat": "---\ntitle: \"{{title|slice:0,-11}} | Wikiwand\"\nauthor: \"John Doe\"\ndates:\n  - created: \"{{date|date:\"MMMM D, YYYY\"}}\"\n  - modified: \"{{date|date:\"MMMM D, YYYY\"}}\"\ntags: [\" ReadItLater wikiwand clippings \"]\naliases: [\"\", \"\"]\nabstract: \"{{description}}\"\nlink: \"{{url}}\"\nbreaks: \"false\"\nlang: \"pt-BR\"\n---\n\n<!-- {{title|slice:0,-11|upper}} ~ WIKIWAND • CRIADO EM {{date|date:\"YYYY/MM/DD\"}} ~ ATUALIZADO EM {{date|date:\"YYYY/MM/DD\"}} -->\n\n# {{title|slice:0,-11}}\n\n<p>&nbsp;</p>\n\n{{variable|callout:(\"INFO\", \"Contexto\", false)}}{{description}}\n\n<p>&nbsp;</p>\n\n<span class=\"text-center\" align=\"center\">![Alt Text]({{image}})  \n<small>Legenda aqui.</small></span>\n\n<p>&nbsp;</p>\n\n{{content}}\n\n<!-- SEPARADOR -->\n\n<p>&nbsp;</p>\n\n<hr class=\"style-two\" />\n\n<p>&nbsp;</p>\n\n- **Fonte:** _“[{{title|slice:0,-11}}]({{url}})”_ | por _John Doe_ • Wikiwand\n- {{date|date:\"MMMM D, YYYY\"}}\n\n<p>&nbsp;</p>\n\n###### tags:\n\n#ReadItLater #wikiwand #clippings \n\n<p>&nbsp;</p>\n\n",
  "properties": [],
  "triggers": [
    "http://wikiwand.com/",
    "https://wikiwand.com/",
    "http://www.wikiwand.com/",
    "https://www.wikiwand.com/",
    "http://wikiwand.com/pt/",
    "https://wikiwand.com/pt/",
    "http://www.wikiwand.com/pt/",
    "https://www.wikiwand.com/pt/",
    "http://wikiwand.com/ru/",
    "https://wikiwand.com/ru/",
    "http://www.wikiwand.com/ru/",
    "https://www.wikiwand.com/ru/",
    "http://wikiwand.com/es/",
    "https://wikiwand.com/es/",
    "http://www.wikiwand.com/es/",
    "https://www.wikiwand.com/es/",
    "http://wikiwand.com/fr/",
    "https://wikiwand.com/fr/",
    "http://www.wikiwand.com/fr/",
    "https://www.wikiwand.com/fr/"
  ],
  "noteNameFormat": "{{title|slice:0,-11|replace:(\"\\\"\":\"\",\"?\":\"\",\"!\":\"\",\"\\'\":\"\",\"\\:\":\"\",\".\":\"\",\" - \":\"\",)}}",
  "path": "Clippings"
}

This is the template I created manually (based on the previous one) to import it because the duplication isn't working:

{
	"schemaVersion": "0.1.0",
	"name": "Wikipedia",
	"behavior": "create",
	"noteContentFormat": "---\ntitle: \"{{schema:@Article:name}} | Wikipedia\"\nauthor: \"John Doe\"\ndates:\n  - created: \"{{published|date:\"MMMM D, YYYY\"}}\"\n  - modified: \"{{date|date:\"MMMM D, YYYY\"}}\"\ntags: [\" ReadItLater wikipedia {{schema:@Article:headline|snake}} clippings \"]\naliases: [\"\", \"\"]\nabstract: \"{{description}}\"\nlink: \"{{url}}\"\nbreaks: \"false\"\nlang: \"pt-BR\"\n---\n\n<!-- {{schema:@Article:name|upper}} ~ WIKIPEDIA • CRIADO EM {{published|date:\"YYYY/MM/DD\"}} ~ ATUALIZADO EM {{date|date:\"YYYY/MM/DD\"}} -->\n\n# {{schema:@Article:name}}\n\n<p>&nbsp;</p>\n\n{{variable|callout:(\"INFO\", \"Contexto\", false)}}{{description}}\n\n<p>&nbsp;</p>\n\n<span class=\"text-center\" align=\"center\">![Alt Text]({{image}})  \n<small>Legenda aqui.</small></span>\n\n<p>&nbsp;</p>\n\n{{content}}\n\n<!-- SEPARADOR -->\n\n<p>&nbsp;</p>\n\n<hr class=\"style-two\" />\n\n<p>&nbsp;</p>\n\n- **Fonte:** _“[{{schema:@Article:name}}]({{url}})”_ | por _John Doe_ • Wikipedia\n- {{date|date:\"MMMM D, YYYY\"}}\n\n<p>&nbsp;</p>\n\n###### tags:\n\n#ReadItLater #wikipedia #{{schema:@Article:headline|snake}} #clippings \n\n<p>&nbsp;</p>\n\n",
	"properties": [],
	"triggers": [
		"http://wikipedia.org/",
		"https://wikipedia.org/",
		"http://en.wikipedia.org/",
		"https://en.wikipedia.org/",
		"http://pt.wikipedia.org/",
		"https://pt.wikipedia.org/",
		"http://es.wikipedia.org/",
		"https://es.wikipedia.org/",
		"http://fr.wikipedia.org/",
		"https://fr.wikipedia.org/",
		"http://ru.wikipedia.org/",
		"https://ru.wikipedia.org/",
		"http://it.wikipedia.org/",
		"https://it.wikipedia.org/"
	],
	"noteNameFormat": "{{schema:@Article:name|replace:(\"\\\"\":\"\",\"?\":\"\",\"!\":\"\",\"\\'\":\"\",\"\\:\":\"\",\".\":\"\",\" - \":\"\",)}}",
	"path": "Clippings"
}

Note: I'm not a programmer and I don't understand anything related to that, so it's very possible that I messed up somewhere in the process since I'm totally clueless about it. And not being a native English speaker might make it worse.

Thanks in advance for your attention.

@SamejSpenser SamejSpenser added the bug Something isn't working label Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant