zotero-better-bibtex: Renaming attachments directly or based on parent items doesn't change betterbibtex json attachment filename

Debug log ID

U7VV7QP3-euc/7.0.5

What happened?

I tried to look for this problem among the Issues and Discussions and and hesitated before writing this up as it should be so basic that I thought it is me that must be doing something wrong.

Case is simple enough: You realize there is a typo or some other need to rename the attachment and possibly even the parent item. This can be done two ways:

  1. Rename the parent item first and have the attachment based on the parent item (Zotero template might interfere with how long the filename can get).
  2. Rename the attachement, the title and the parent item. Quite a big job.

Wait a few seconds and check the json (if you have set automatic export on changes)… – No changes in the pdf. Export the json manually as if doing the export for the very first time for the whole library. – No changes in the pdf. Rename not reflected.

Current workaround to get the rename updated: manually change BibTex key: this will change the citeKey and adds a property to the Extra YAML key with this change. Then check the json: the rename update is reflected now.

Is there some way to spare all this, or am I dumb enough to keep doing something wrong?

I tried to create for you some debug lines but not sure what you can make of this. I tried to go up and didn’t see the relevant parts. Then in the meantime I sent the log but not sure if that caught anything, so I kept this for you:

(3)(+0000000): UPLOAD BATCH:

(3)(+0000000): [ "0": { "key": "VVSH4KV9" "version": 19407 "extra": "Citation Key: WeszpremiKalmanMagyarzsido" "tags": [ "0": { "tag": "📘" } "1": { "tag": "#magyarságkutatás/zsidó-héber-szemita-talmud/zsidó-leleplezés" } "2": { "tag": "#zsidó-héber-szemita-talmud/zsidó-leleplezés" } "3": { "tag": "#zsidó-leleplezés" } ] "dateModified": "2025-01-16T22:03:23Z" } ]

(3)(+0000000): Uploading 1 item

(3)(+0000000): Sending If-Unmodified-Since-Version: 19409

(3)(+0000000): [ConcurrentCaller] Running function (0/4 running, 0 queued)

(3)(+0000001): HTTP POST "[{"key":"VVSH4KV9","version":19407,"extra":"Citation Key: WeszpremiKalmanMagyarzsido","tags":[{"tag":"📘"},{"tag":"#magyarságkutatás/zsidó-héber-szemita-talmud/zsidó-leleplezés"},{"tag":"#zsidó-héber-szemita-talmud/zsidó-leleplezés"},{"tag":"#zsidó-leleplezés"}],"dateModified":"2025-01-16T22:03:23Z"}]" to https://api.zotero.org/users/9697111/items

(3)(+0000043): {better-bibtex: <7.0.5 65JF53YN>} sync started

(4)(+0000035): SELECT A.itemID FROM items A WHERE 1 AND A.itemID NOT IN (SELECT itemID FROM deletedItems) AND libraryID=? [1]

(3)(+0000001): Creating string pref 'extensions.zotero.translators.better-bibtex.autoExport.C%3A%5CUsers%5CODOR%5CDocuments%5CObsidian%5CCORPUS%5CSYSTEM%5CZOTERO%5Cbibliography%2ejson'

(3)(+0000281): HTTP POST https://api.zotero.org/users/9697111/items succeeded with 200

(3)(+0000000): [ConcurrentCaller] Done with function (0/4 running, 0 queued)

(4)(+0000001): Tags haven't changed

(4)(+0000000): Relations have not changed for item 1/VVSH4KV9

(4)(+0000000): Field 'dateAdded' has not changed

(4)(+0000000): Field 'dateModified' has not changed

(3)(+0000000): Collections have not changed for item 19771

(3)(+0000000): Saving to sync cache:

(3)(+0000000): [ "0": { "key": "VVSH4KV9" "version": 19410 "library": { "type": "user" "id": 9697111 "name": "zanodor" "links": { "alternate": { "href": "https://www.zotero.org/zanodor" "type": "text/html" } } } "links": { "self": { "href": "https://api.zotero.org/users/9697111/items/VVSH4KV9" "type": "application/json" } "alternate": { "href": "https://www.zotero.org/zanodor/items/VVSH4KV9" "type": "text/html" } } "meta": { "numChildren": 1 } "data": { "key": "VVSH4KV9" "version": 19410 "itemType": "document" "title": "Weszprémi Kálmán – A magyarországi zsidóságról – a magyarországi zsidók statisztikája" "creators": [] "abstractNote": "" "publisher": "" "date": "" "language": "" "shortTitle": "" "url": "" "accessDate": "" "archive": "" "archiveLocation": "" "libraryCatalog": "" "callNumber": "" "rights": "" "extra": "Citation Key: WeszpremiKalmanMagyarzsido" "tags": [ "0": { "tag": "#magyarságkutatás/zsidó-héber-szemita-talmud/zsidó-leleplezés" } "1": { "tag": "#zsidó-héber-szemita-talmud/zsidó-leleplezés" } "2": { "tag": "#zsidó-leleplezés" } "3": { "tag": "📘" } ] "collections": [ "0": "KYLKQNSP" ] "relations": {} "dateAdded": "2024-02-19T02:14:59Z" "dateModified": "2025-01-16T22:03:23Z" } } ]

(4)(+0000000): INSERT OR REPLACE INTO syncCache (libraryID, key, syncObjectTypeID, version, data) VALUES (?, ?, ?, ?, ?) [1, 'VVSH4KV9', 3, 19410, '{"key":"VVSH4KV9","version":19410,"library":{"type":"user","id":9697111,"name":"zanodor","links":{"alternate":{"href":"https://www.zotero.org/zanodor","type":"text/html"}}},"links":{"self":{"href":"https://api.zotero.org/users/9697111/items/VVSH4KV9","type":"application/json"},"alternate":{"href":"https://www.zotero.org/zanodor/items/VVSH4KV9","type":"text/html"}},"meta":{"numChildren":1},"data":{"key":"VVSH4KV9","version":19410,"itemType":"document","title":"Weszprémi Kálmán – A magyarországi zsidóságról – a magyarországi zsidók statisztikája","creators":[],"abstractNote":"","publisher":"","date":"","language":"","shortTitle":"","url":"","accessDate":"","archive":"","archiveLocation":"","libraryCatalog":"","callNumber":"","rights":"","extra":"Citation Key: WeszpremiKalmanMagyarzsido","tags":[{"tag":"#magyarságkutatás/zsidó-héber-szemita-talmud/zsidó-leleplezés"},{"tag":"#zsidó-héber-szemita-talmud/zsidó-leleplezés"},{"tag":"#zsidó-leleplezés"},{"tag":"📘"}],"collections":["KYLKQNSP"],"relations":{},"dateAdded":"2024-02-19T02:14:59Z","dateModified":"2025-01-16T22:03:23Z"}}']

(3)(+0000000): [ConcurrentCaller] All tasks are done

(4)(+0000003): Beginning DB transaction 6QbdQKDj

(4)(+0000011): Item 19771 has not changed

(4)(+0000000): Updating database with new library data

(4)(+0000000): UPDATE libraries SET version=? WHERE libraryID=? [19410, 1]

(4)(+0000001): UPDATE items SET version=19410 WHERE itemID IN (?) [19771]

(4)(+0000000): UPDATE items SET synced=1 WHERE itemID IN (?) [19771]

(4)(+0000002): Committed DB transaction 6QbdQKDj

All the best Z.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 59 (21 by maintainers)

Commits related to this issue

Most upvoted comments

Greyed out means the control is disabled (you can’t edit it), not that the feature is off (that would show as unchecked, regardless of whether the control is enabled)

The one change I’ve started seeing (don’t know since when) is not remembering my preference for ‘Keep Updated’. I need to always check it on each manual export. It may be a default setting…?

Yes. If it didn’t always reset, that would be a bug. I don’t want people setting up auto-exports by accident.

when you check it, the Background Export goes unchecked. Maybe that is the source of all our problems?

It should remain checked but disabled. I have no influence on the colorscheme, it is a bit hard to tell, but it remains checked for me. Auto-exports are always background exports.

I’ll look at the log later when I’m home.

Yes, I need the PDF attachment’s filename (not too concerned for the title) in the json in line with the physically saved filename I manage to do with Zotero. If the attachment filename is incorrect in the json, my Python script’s extractor will have no legal file to point to in my Obsidian vault.

OK, no problem. This should have just worked, so that means I’m likely not updating the cache correctly.

Automatic exports don’t do attachment export.

Ah, that’s a bummer, but still… if I manually export the whole json…it still will not sport my new changed filenames, unless I change the citationKey. So this all this runaround will always be needed?

No, that’s a problem I need to address.

Well, I’d like for my settings stick… I didn’t have problem my auto-export settings not stick in the past. Meh…

They do stick. Auto-exports are only deleted when removed from the preferences. Which is why I asked.

BTW, all looks okay in settings:

Then there’s something wrong with that too. I’ll investigate.

I was wary of removing my own official add-on because as I looked around in the plugin settings, I couldn’t find an export for the settings and didn’t want to remove the extension.

Removing of the extension never removes configuration or data. There is also a facility to export/import preferences, but that should only be needed to get your settings to another computer.

Image

New build will drop momentarily