Unable to overwrite previous export including file

On standlone zotero on linux, when exporting a collection as bibtex/biblatex (possibly others) including files, a directory is created instead of a file. However, at this point, it becomes impossible to overwrite this directory by exporting again without removing the directory first. Selecting the old directory and then click save **always** navigate to the directory rather than saving the file using the directory name. It feels like the file picker is initialized to only allow picking a file and therefore never return the name of a existing directory.
  • I'm not sure this is atypical behavior, but in any case, Zotero uses the file picker of its underlying (Firefox) framework, so I wouldn't expect this to change. What's your use case here?
  • Well, the use case is to save/backup/export to overwrite a previous version after new articles (or other changes) are added to a collection.

    I'm pretty sure the underlying GTK file picker doesn't have this problem/can be configured to do so. Does the firefox file picker not have any option at all to configure what's an allowed return value?
  • If I'm reading this correctly. https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFilePicker modeGetFolder should be used when saving a directory.
  • Any reason you need to export with files? That seems like an incredibly cumbersome and slow (also, not loss-less) back-up process. Use BBT to incrementally update a .bib file with your Zotero database for use with bib(la)tex and back up the Zotero data & storage folder for back-up.

    If you want a more custom solution, I'm afraid you're on your own. No one has ever asked about this in 10+ years, so it's pretty certain it's not worth dev time to look into.
  • edited September 26, 2020
    Export with file was to get rid of host absolute path.

    Fixing it myself isn’t a problem but I do believe this is clearly a bug. The use case for overriding should be as valid as having the export option at all.
  • 1) You're misreading the documentation. modeGetFolder is for picking an existing folder, not for saving. It doesn't let you specify a name.

    2) This seems like a limitation of the filepicker on Linux. On macOS, if you click a folder and then click Save, it will open the folder, but if an existing folder isn't selected, it will prompt to overwrite the existing folder. On Linux, clicking Save when the specified name is the same as an existing folder will open that folder, regardless of current selection.
  • > You're misreading the documentation. modeGetFolder is for picking an existing folder, not for saving. It doesn't let you specify a name.

    OK, yeah this is the aspect I wasn't sure about from the document.

    > On Linux, clicking Save when the specified name is the same as an existing folder will open that folder, regardless of current selection.

    So is this a firefox bug or a GTK one...
  • So is this a firefox bug or a GTK one...
    As far as I can tell, yes.
  • (I was asking trying to ask which one it is......). Now I do feel like the one responsible for the behavior and the text on the "Save" button is where the bug should be filed against. The save button is clearly not doing the saving.

    As an aside, do you have any idea what in firefox is responsible for handling `GTK_USE_PORTAL` environment variable? I'm using KDE so it'll be even better if it can use the native KDE file picker instead. According to other posts I find, firefox v64 starts supporting this. Is this something that is handled by firefox automatically (i.e. I need to build against a newer version of it) or is it handled by the application rather than the underlying library.
  • From the behavior I assume GTK. But you'd have to see if you can reproduce it in another app.
  • Based on https://github.com/archlinuxcn/repo/blob/59a39d2800c4ae81586a0ac19e5ac81752121b48/archlinuxcn/zotero/PKGBUILD#L19 I'm using a prebuilt binary. Any idea which version of firefox (library, xulrunner? gecko?) it is built with?
  • Zotero is currently based on Firefox 60 ESR. An upgrade to 78 ESR is in progress.

    You can see if you can reproduce this using nsIFilePicker in a current Firefox version.
  • > Zotero is currently based on Firefox 60 ESR. An upgrade to 78 ESR is in progress.

    Thanks.

    > You can see if you can reproduce this using nsIFilePicker in a current Firefox version.

    Unfortunately, neither the KDE or GTK version of the file picker allows this.... =(...
  • > Use BBT to incrementally update a .bib file with your Zotero database for use with bib(la)tex and back up the Zotero data & storage folder for back-up.

    I've installed BBT and tried exporting. However, the exported file still contains absolute path to the local zotero file database which is undesirable. The only way I can find to get rid of it is still to enable file exporting (and then use `.gitignore` to avoid checking the files in). Please let me know if there's another way to disable this behavior without using file export that I missed.
Sign In or Register to comment.