wileyyugioh/zotmoov

zotmoove.js PathUtils error

Closed this issue · 2 comments

Not sure how to use github to report this, but on line 95 of zotmoove.js it says:

clone.setField('title', PathUtils.filename(clone.attachmentPath));
However, I believe it should be

clone.setField('title', PathUtils.filename(final_path));
because final_path is a full path that PathUtils can work with, but clone.attachmentPath is not. Move was not working for me until I made this change for myself.

That's a weird bug. For some reason it works on my Mac laptop. Maybe platform specific? Anyways I added your fix to the latest version. Thanks!

For posterity, I think I figured out the reason. Basically when we set attachmentPath the Zotero code does some underlying calculations to change the uri. This creates a race condition for the second line that can be fixed simply by using the final_path variable.