Fix PathUtils.joinRelatve() error when changing LABD on Windows

We store relative paths with forward slashes, but PathUtils requires
platform-specific slashes, so it was failing with
NS_ERROR_FILE_UNRECOGNIZED_PATH.

https://forums.zotero.org/discussion/115552/zotero-7-path-problem
This commit is contained in:
Dan Stillman 2024-07-01 03:50:37 -04:00
parent 3df1a9b812
commit d73a6f8a11

View file

@ -623,6 +623,8 @@ Zotero_Preferences.Attachment_Base_Directory = {
let storedPath = attachment.attachmentPath;
if (storedPath.startsWith(Zotero.Attachments.BASE_PATH_PLACEHOLDER)) {
relPath = storedPath.substr(Zotero.Attachments.BASE_PATH_PLACEHOLDER.length);
// Use platform-specific slashes, which PathUtils.joinRelative() requires below
relPath = Zotero.Attachments.fixPathSlashes(relPath);
}
}
catch (e) {