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]: Couldn't upload Attachments with Obsidian folder structure while using the Folder Path replacer #314

Closed
3 tasks done
vu-truong opened this issue Feb 21, 2024 · 1 comment
Assignees
Labels
🐛 Bug Something isn't working 👍 Good first issue Good for newcomers

Comments

@vu-truong
Copy link

vu-truong commented Feb 21, 2024

Issue validation

  • I checked the issue to prevent duplicate
  • I checked my configurations files and the documentation
  • My issue concern doesn't concern the Mkdocs template

Command used

Upload single current active note

Plugin version

6.15.5

Describe the bug

Hi, Lisandra
I've found that I couldn't upload Attachments with Obsidian folder structure while using the Folder Path replacer:
image

If I remove the Folder Path replacer, everything is okay. So I think there is a bug about replacing the Folder Path when uploading Attachments with Obsidian folder structure.

Here is my vault:
image

Here is my attachment config:
image

And here is the error:
image

How to reproduce ?

No response

Minimal Reproducible Example

---
share: true
comments: false
hidden: true
title: Home
---


![[Attachments/discord.png]]

Configuration

{
  "github": {
    "branch": "main",
    "automaticallyMergePR": true,
    "dryRun": {
      "enable": false,
      "folderName": "github-publisher"
    },
    "tokenPath": "%configDir%/plugins/%pluginID%/env",
    "api": {
      "tiersForApi": "Github Free/Pro/Team (default)",
      "hostname": ""
    },
    "workflow": {
      "commitMessage": "[PUBLISHER] Merge",
      "name": ""
    },
    "verifiedRepo": true
  },
  "upload": {
    "behavior": "obsidian",
    "defaultName": "docs",
    "rootFolder": "",
    "yamlFolderKey": "",
    "frontmatterTitle": {
      "enable": false,
      "key": "title"
    },
    "replaceTitle": [],
    "replacePath": [
      {
        "regex": "MyBlog",
        "replacement": "",
        "type": "path"
      }
    ],
    "autoclean": {
      "enable": false,
      "excluded": []
    },
    "folderNote": {
      "enable": false,
      "rename": "index.md",
      "addTitle": {
        "enable": false,
        "key": "title"
      }
    },
    "metadataExtractorPath": ""
  },
  "conversion": {
    "hardbreak": false,
    "dataview": true,
    "censorText": [],
    "tags": {
      "inline": false,
      "exclude": [],
      "fields": []
    },
    "links": {
      "internal": false,
      "unshared": false,
      "wiki": false,
      "slugify": "disable"
    }
  },
  "embed": {
    "attachments": true,
    "overrideAttachments": [],
    "keySendFile": [],
    "notes": false,
    "folder": "docs/Attachments",
    "convertEmbedToLinks": "keep",
    "charConvert": "->",
    "useObsidianFolder": true
  },
  "plugin": {
    "shareKey": "share",
    "excludedFolder": [],
    "copyLink": {
      "enable": false,
      "links": "",
      "removePart": [],
      "transform": {
        "toUri": true,
        "slugify": "lower",
        "applyRegex": []
      }
    },
    "setFrontmatterKey": "Set"
  }
}

Relevant log output

No response

OS

Windows

Anything else?

No response

Obsidian information

SYSTEM INFO:
	Obsidian version: v1.5.3
	Installer version: v1.4.16
	Operating system: Windows 10 Home Single Language 10.0.22621
	Login status: not logged in
	Insider build toggle: off
	Live preview: off
	Base theme: adapt to system
	Community theme: none
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 1
	Plugins enabled: 1
		1: Github Publisher v6.15.5

RECOMMENDATIONS:
	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.
@vu-truong vu-truong added the 🐛 Bug Something isn't working label Feb 21, 2024
@Mara-Li Mara-Li added the 👍 Good first issue Good for newcomers label Feb 21, 2024
@Mara-Li
Copy link
Member

Mara-Li commented Feb 21, 2024

Found what cause the 422 error : HttpError: path contains a malformed path component: {"resource":"Commit","field":"path","code":"invalid"}

I forgot to normalizePath after the regex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working 👍 Good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants