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

When items are merged, itemIDs should be written to extra:EdTechHub.ItemAlsoKnownAs #34

Closed
bjohas opened this issue Feb 23, 2020 · 18 comments

Comments

@bjohas
Copy link
Collaborator

bjohas commented Feb 23, 2020

When items are merged, itemIDs should be saved to extra:ETHItemAlsoKnownAs.

In other words, when items are merged, the same process should take places as when "saving item IDs" from the right-click menu (including checking for old IDs, as per #26).

(Note: Issue #27 should be resolved first.)

@bjohas
Copy link
Collaborator Author

bjohas commented Feb 25, 2020

Adding to this:

The plugin already merges the archiveLocation/extra:ETHItemAlsoKnownAs fields when items are merged. However, this relies on the items having a populated archiveLocation/extra:ETHItemAlsoKnownAs field.

This issue adds the feature that, when items are merged, empty archiveLocation/extra:ETHItemAlsoKnownAs should be populated with the itemsIDs (as if the 'save itemid action was run manually).

@bjohas bjohas changed the title When items are merged, itemIDs should be written to extra:ETHItemAlsoKnownAs When items are merged, itemIDs should be written to extra:EdTechHub.ItemAlsoKnownAs Apr 12, 2020
@bjohas
Copy link
Collaborator Author

bjohas commented Apr 14, 2020

Which branch is this in?

@retorquere
Copy link
Collaborator

Not yet on a branch -- this should have been in progress

@edtechbot
Copy link
Collaborator

🤖 this is your friendly neighborhood build bot announcing test build 0.0.23.226 ("fixes #34")

Install in Zotero by downloading test build 0.0.23.226, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

@bjohas
Copy link
Collaborator Author

bjohas commented May 25, 2020

This works! Thanks!

However, when I use, 'save item id', a spurious number appears in the item id (which I cannot see in the item metadata). May not be relevant.

@retorquere
Copy link
Collaborator

Oh that's the library id. The part before the colon right? That's easy to remove.

@bjohas
Copy link
Collaborator Author

bjohas commented May 25, 2020

No - on 'save item id', I get this:

EdTechHub.ItemAlsoKnownAs: 59841;2259720:JLD5AI8V

So the lib is there as expected, but the 59841 is spurious.

There's another problem, which surfaces on 'merge'. If I do 'save item id' first, then I get the merged record as follows:

EdTechHub.ItemAlsoKnownAs: 59841;2259720:JLD5AI8V;59842;2259720:X922H87F

This is correct, bar the spurious numbers.

However, if I do not do 'save item id' first, I get

EdTechHub.ItemAlsoKnownAs: 59841;59842

i.e., I only get the spurious numbers, when the expected result is

EdTechHub.ItemAlsoKnownAs: 2259720:JLD5AI8V;2259720:X922H87F

@bjohas
Copy link
Collaborator Author

bjohas commented May 25, 2020

Updated comment above.

Btw. the spurious numbers are consecutive: In another merge op, I got 59846;59847. So it might be some kinda of operation sequence number...?

@edtechbot
Copy link
Collaborator

🤖 this is your friendly neighborhood build bot announcing test build 0.0.23.229 ("key, not itemID")

Install in Zotero by downloading test build 0.0.23.229, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

@retorquere
Copy link
Collaborator

Ah -- you asked for the itemID, those are numeric. 229 has the item key.

@bjohas
Copy link
Collaborator Author

bjohas commented May 26, 2020

AHH - apologies!

I now get the item key, great! Could you restore the group_id? I.e., at the moment I get

EdTechHub.ItemAlsoKnownAs: WIQJGYSQ;2T5XC83G

but I want this (with the group_id):

EdTechHub.ItemAlsoKnownAs: 2259720:JLD5AI8V;2259720:X922H87F

Then please release! Many thanks!

retorquere added a commit that referenced this issue May 26, 2020
@edtechbot
Copy link
Collaborator

🤖 this is your friendly neighborhood build bot announcing test build 0.0.23.232 ("lib key + item key")

Install in Zotero by downloading test build 0.0.23.232, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

@retorquere
Copy link
Collaborator

I'd prefer it if you could confirm before I merge it into master

@bjohas
Copy link
Collaborator Author

bjohas commented May 26, 2020

Sure - let me confirm!

@bjohas
Copy link
Collaborator Author

bjohas commented May 26, 2020

On 0.0.23.232, I now do not get an entry in extra at all (and no item history).

@bjohas
Copy link
Collaborator Author

bjohas commented May 27, 2020

There's also an error. With this version, when I use 'save item id', I get 'uri undefined'.

@edtechbot
Copy link
Collaborator

🤖 this is your friendly neighborhood build bot announcing test build 0.0.23.233 ("something must have changed in the handling of merge")

Install in Zotero by downloading test build 0.0.23.233, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

@bjohas
Copy link
Collaborator Author

bjohas commented May 29, 2020

thank you - now works as advertised!! Many thanks - this is very much appreciated!

Happy for the latest changes to be released!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants