Bug 138588 - Not possible to copy and paste Zotero citation
Summary: Not possible to copy and paste Zotero citation
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.0.3.1 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 151991 (view as bug list)
Depends on:
Blocks: Bibliography
  Show dependency treegraph
 
Reported: 2020-12-01 02:02 UTC by SergeiD
Modified: 2023-09-03 23:10 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
This picture shows what happens with copy / paste and what it should look like + reference info (124.23 KB, image/png)
2023-09-03 23:06 UTC, Thesmallest
Details

Note You need to log in before you can comment on or make changes to this bug.
Description SergeiD 2020-12-01 02:02:15 UTC
Description:
Why such simple stuff cause such many pain? Could someone explain why it is impossible copy-and-paste a citation in same document? Is it very hard to fix notorious the copying referencemarks ten years old bug? MS Word works like a charm with Zotero (and any other) bibliography, but opensource LO and opensource Zotero can't do this very simple stuff copying the citation from one place to other in the same document. Can anyone give a description what needs to be done to make this simple function work?


Steps to Reproduce:
1. Add Zotero citation
2. Copy and paste the inserted cite


Actual Results:
The insertion is a plain text, so it is more impossible to edit the cite.

Expected Results:
The insertion is a referencemark and allow edit the cite.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.0.3.1
Build ID: 00(Build:1)
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: ru-RU (ru_RU.UTF-8); ИП: ru-RU
Ubuntu package version: 1:7.0.3-0ubuntu0.20.04.1
Calc: threaded
Comment 1 Dieter 2020-12-16 07:41:53 UTC
I confirm it with

Version: 7.0.4.2 (x64)
Build ID: dcf040e67528d9187c66b2379df5ea4407429775
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: threaded
Comment 2 QA Administrators 2022-12-17 03:19:28 UTC Comment hidden (obsolete)
Comment 3 Buovjaga 2023-03-06 09:05:22 UTC
*** Bug 151991 has been marked as a duplicate of this bug. ***
Comment 4 Buovjaga 2023-03-06 09:18:09 UTC
Please explain the steps better. This is my first time using Zotero.

I created an item in Zotero.
I added a citation in Writer, picked my item.
I selected the citation mark, copied and pasted elsewhere in the Writer document.
It pasted correctly and I had two footnotes.

I don't see the bug? Or do I have to do something else to see the bug?
I'm using Zotero 6.0.22

Arch Linux 64-bit, X11
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 617f392a0adfc07afca87eea9ec75d7852658de5
CPU threads: 8; OS: Linux 6.2; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 6 March 2023
Comment 5 Thesmallest 2023-09-03 23:06:50 UTC
Created attachment 189326 [details]
This picture shows what happens with copy / paste and what it should look like + reference info

(In reply to Buovjaga from comment #4)
> Please explain the steps better. This is my first time using Zotero.
> 
> I created an item in Zotero.
> I added a citation in Writer, picked my item.
> I selected the citation mark, copied and pasted elsewhere in the Writer
> document.
> It pasted correctly and I had two footnotes.
> 
> I don't see the bug? Or do I have to do something else to see the bug?
> I'm using Zotero 6.0.22
> 
> Arch Linux 64-bit, X11
> Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
> Build ID: 617f392a0adfc07afca87eea9ec75d7852658de5
> CPU threads: 8; OS: Linux 6.2; UI render: default; VCL: kf5 (cairo+xcb)
> Locale: fi-FI (fi_FI.UTF-8); UI: en-US
> Calc: threaded
> Built on 6 March 2023

Steps to reproduce:
1. In LO turn on View > Field shadings
2. Install Zotero and the zotero extension in your LO installation
3. Insert a reference in LO
4. copy and paste it
5. The reference is gone (delete the real reference but don't delete the copied in reference. Now click "add bibliography". Zotero won't recognize any reference anymore).


I read in ask.libreoffice.org that zotero references aren't real references. They get created and processed with macros (but they just reference a trigger). I'd guess that something is lost when you copy and paste the in-text reference.

I believe the relevant code is in the file: zotero.jar (--> chrome/content/zotero/xpcom/integration.js) inside of: Zotero.Integration.Interface.prototype.addBibliography = Zotero.Promise.coroutine(function* () {}. There you'll find the following code:

if (!me._session.data.style.hasBibliography) {
    throw new Zotero.Exception.Alert("integration.error.noBibliography", [],
    "integration.error.title");
}


This code (I think) doesn't know that the copied in reference is indeed a reference.


Tested with Libreoffice:
Downloaded from: https://dev-builds.libreoffice.org/daily/master/Linux-rpm_deb-x86_64@tb99-TDF/2023-09-03_04.38.37/LibreOfficeDev_24.2.0.0.alpha0_Linux_x86-64_deb.tar.gz

About > help:
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 3c7a35dd28fbc337a23473873b3dd47392b883ae
CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded


System info (inside virtualbox):
OS: Debian GNU/Linux 12 (bookworm) 64-bit
Windowing system: Wayland
DE: GNOME 40
Comment 6 Thesmallest 2023-09-03 23:10:34 UTC
Tested with zotero version 6.0.26