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

Note templates issues #177

Closed
mjthoraval opened this issue Oct 11, 2022 · 31 comments
Closed

Note templates issues #177

mjthoraval opened this issue Oct 11, 2022 · 31 comments
Labels
bug Something isn't working

Comments

@mjthoraval
Copy link

I do not understand how the note templates features should be used. The options Insert Template from the Edit menu seem to be visible from everywhere. But they do not do anything most of the time.
Could you help me clarify how it should be used? From where to where, what should be opened in order to work? What does it take as an entry and what is the target? Does it work on an individual annotation, or is it only accessible from the item level? Is it only working from the Workspace? Or should I have a note opened to have anything to happen?

@mjthoraval mjthoraval added the bug Something isn't working label Oct 11, 2022
@windingwind
Copy link
Owner

There are 3 types of template you could access from menu: Text, Item, and Note. Item and Note templates requires user to select items/notes as input.

Generally speaking, the templates will be inserted after the cursor line in the main note if the workspace is open.

You could still run a template outside the workspace. That way you would get the result in clipboard.

Note that only inserting to the workspace directly guarantees the template runs corrrectly. Some annotation-related templates may not work properly via clipboard.

@mjthoraval
Copy link
Author

mjthoraval commented Oct 12, 2022

I see. Indeed it seems to work only in the Main Note.
Is there any reason why it cannot work in other notes?

Also, I find the access from the menu -> Edit a bit confusing, as it does really show where it is going to be inserted. I guess it is related to the ability to copy the template to the clipboard. Would it be possible to insert templates also from a right click in the note?
I see now the popup message "Template Copied" if it is copied to the clipboard. I would find it more clear to say "Template Copied to Clipboard", if you think that is not too much.

I was testing the "[Item] collect annotations by color". It seems that it cannot collect the annotations made from outside Zotero and later imported to Zotero. I guess this is because they do not have the standard Zotero colour. Should they be collected in "Other colours"?

For the template on annotation, can you control completely the format on how they are inserted, or do you simply use the same format as described here?
https://www.zotero.org/support/note_templates

For example, I have seen this post in the Forums asking to get the annotation as:
[Kaminski et al., 2007, p. 1](zotero://open-pdf/library/items/A45K64BY?page=1&annotation=WFPFFVIU)
https://forums.zotero.org/discussion/100321/cite-pdf-annotation-from-markdown-editor-with-autocompletion
Can this be done with your plugin, or do you know if another plugin can do it?

When you insert a note template, is it possible to get it dynamically updated in some way? For example to keep refreshing when new annotations are added? Constantly refreshing is probably overkill, but maybe inserting the template in an imbedded frame with a refresh button at the top right corner?

I keep seeing some popup window that do not disappear, like "Running Template". I am not sure why it is not going away?
I find it a bit invasive, as it even stays on top or windows from other programs.
Is there a way to get rid of them? Like closing from a cross at the top right? I realise that it goes away when I click on it.

@windingwind
Copy link
Owner

Is there any reason why it cannot work in other notes?

It is so because I want to realize it quickly. If we know which note is working on and focused, it is possible to work in other notes.

Also, I find the access from the menu -> Edit a bit confusing

Yes, I agree.

Would it be possible to insert templates also from a right click in the note?

Yes. That's planned. In this way, we could allow templates to insert into other notes outside the workspace.

I would find it more clear to say "Template Copied to Clipboard",

OK.

I guess this is because they do not have the standard Zotero colour. Should they be collected in "Other colours"?

Yes, you are right. adding a new row to collect other colours is easy.

Template: Click to expand
${await new Promise(async (r) => {
  async function getAnnotation(item) {
    try {
      if (!item || !item.isAnnotation()) {
        return null;
      }
      let json = await Zotero.Annotations.toJSON(item);
      json.id = item.key;
      delete json.key;
      for (let key in json) {
        json[key] = json[key] || "";
      }
      json.tags = json.tags || [];
      return json;
    } catch (e) {
      Zotero.logError(e);
      return null;
    }
  }

  async function getAnnotationsByColor(_item, colorFilter) {
    const annots = _item
      .getAnnotations()
      .filter(colorFilter);
    let annotations = [];
    for (let annot of annots) {
      const annotJson = await getAnnotation(annot);
      annotJson.attachmentItemID = _item.id;
      annotations.push(annotJson);
    }

    const editor =
      await Zotero.Knowledge4Zotero.knowledge.getWorkspaceEditorInstance();
    await editor.importImages(annotations);
    return Zotero.EditorInstanceUtilities.serializeAnnotations(annotations);
  }

  const attachments = Zotero.Items.get(topItem.getAttachments()).filter((i) =>
    i.isPDFAttachment()
  );
  let res = "";
  let colors = ["#ffd400", "#ff6666", "#5fb236", "#2ea8e5",  "#a28ae5"];
  let colorYellow = colors[0];
  let colorRed = colors[1];
  let colorGreen = colors[2];
  let colorBlue = colors[3];
  let colorPerple = colors[4];
  for (let attachment of attachments) {
    res += `<h2><p style="background-color:${colorYellow};">Yellow Heading</p></h2>
    ${(await getAnnotationsByColor(attachment, (_annot) => _annot.annotationColor === colorYellow)).html}
    `;
    res += `<h2><p style="background-color:${colorRed };">Red Heading</p></h2>
    ${(await getAnnotationsByColor(attachment, (_annot) => _annot.annotationColor === colorRed)).html}
    `;
    res += `<h2><p style="background-color:${colorGreen };">Green Heading</p></h2>
    ${(await getAnnotationsByColor(attachment, (_annot) => _annot.annotationColor === colorGreen)).html}
    `;
    res += `<h2><p style="background-color:${colorBlue };">Blue Heading</p></h2>
    ${(await getAnnotationsByColor(attachment, (_annot) => _annot.annotationColor === colorBlue)).html}
    `;
    res += `<h2><p style="background-color:${colorPerple };">Perple Heading</p></h2>
    ${(await getAnnotationsByColor(attachment, (_annot) => _annot.annotationColor === colorPerple)).html}
    `;
    res += `<h2><p>Others Heading</p></h2>
    ${(await getAnnotationsByColor(attachment, (_annot) => !colors.includes(_annot.annotationColor))).html}
    `;
  }
  r(res);
})}

or do you simply use the same format as described here

Yes. Zotero already does this, so we do not need to do it twice. However, it is also allowed if you do want to give the annotations a different format.

Can this be done with your plugin, or do you know if another plugin can do it?

No. It only handles the Zotero note. Citing things in an MD file outside Zotero is totally different.

However, if you mean citing items in Zotero notes, that's quite possible. We could discuss that in a new thread.

When you insert a note template, is it possible to get it dynamically updated in some way? For example to keep refreshing when new annotations are added? Constantly refreshing is probably overkill, but maybe inserting the template in an imbedded frame with a refresh button at the top right corner?

Hard to say, at least, it is not possible right now. The result of the template can change dramatically because it has no limit. Some templates even rely on time or other variables, making things more complex.

I keep seeing some popup window that do not disappear, like "Running Template".

That's because the template is still running (the template can be a code sometimes, that's why it may take some time to search the library or process data), or the running process may meet some errors. Just click to hide it.

@windingwind
Copy link
Owner

@mjthoraval
note tempaltes and copy link are available in the right-click menu in note editors.

@windingwind
Copy link
Owner

@mjthoraval

image

You can preview the insert anchor in the right-click menu now(in next release).

@mjthoraval
Copy link
Author

Thank you very much.

I confirm that the code for a adding other colours is working.
I would just change "Perple" to "Purple" in the code.
What happens to the templates when Better Notes is updated? Are the modifications deleted to put the new template?

I can also add templates in any notes now.

@windingwind
Copy link
Owner

I would just change "Perple" to "Purple" in the code.

Yes, you can edit the template freely.

res += `<h2><p style="background-color:${colorPerple };">Perple Heading</p></h2>

to

res += `<h2><p style="background-color:${colorPerple };">Purple Heading or anything you like</p></h2>

What happens to the templates when Better Notes is updated? Are the modifications deleted to put the new template?

No. System templates (name in yellow) might be updated in the future with a new name, like the 'QuickNoteV2' to 'QuickNoteV3'. The old template is always kept, though they are no longer being used. Other templates are maintained by the user and will not be modified, removed, or reset by the plugin.

@sjgknight
Copy link

I have a similar question (so I hope it's ok to add to this issue, rather than creating an effective duplicate). I think this is a great addition to zotero, so thank you for the work on it (obviously the extra complexity of function brings challenges!)

  1. I have a collection, in which I have created some notes from text/image annotations (some also have original text). These notes are tagged 'RQs+aims'
  2. I open a main note, and either right click in it, or open edit->insert options
  3. I select the '[Item] collect annotations and notes by tag' template (which I added from [Documentation] Note Templates from Community #85 - I've also tried with 'collection annotations by tag' template).
  4. That brings up a dialogue to select items, I've tried either selecting all, or selecting the items in a zotero query I ran (they're items I know have this tag, but irritatingly the zotero queries always retain the top level item even though it isn't tagged)
  5. Once I've selected, I get a dialogue to choose my tag(s). I just use RQs+aims here

At this stage, nothing seems to happen? I see the 'running template' message, but I can't see anything being inserted anywhere. I have successfully run one of the other templates (by colour).

Expected behaviour:

Tag 1
Item metadata
annotation
annotation

Item metadata
annotation
annotation

Tag 2 (if I'd selected one)
...

Am I doing something wrong or misunderstanding how this should work?

@windingwind
Copy link
Owner

@sjgknight

I've updated the plugin and some default templates, as well as ones that require active note editors in #85.

They should be OK now.

Some templates are out-of-dated and wrongly set the variable editor as the main note editor, which is now handled by the plugin and can be any active editor.

@mjthoraval
Copy link
Author

@sjgknight Does it work if you first open the Workspace in a tab by clicking on "Open Workspace" above "My Library", and leave that Workspace tab opened?
See the discussion here: #183

@windingwind Even with Release 0.7.15 of the plugin, I am still getting the same behaviour as reported in the other thread. The only way to get the same behaviour: the Workspace must be opened in a Zotero tab before I can use the template "[Item] collect annotations by color". See the screen recording.

@windingwind
Copy link
Owner

@mjthoraval
Did you update the template? The plugin would not modify any existing templates, as I states, even if they are default templates.

You may need to remove the old template and then restart Zotero to update the template after updating the plugin.

@mjthoraval
Copy link
Author

mjthoraval commented Oct 25, 2022

I don't know how to do that?
Ok, from the Template Editor, I have deleted the templates.
Here is what I get now for that template:
image

I am still getting the same problem.

New error:
[JavaScript Error: "ReferenceError: i is not defined" {file: "chrome://knowledge4zotero/content/scripts/index.js line 47518 > AsyncFunction" line: 72}]

Actually the template never works now, even with the Workspace opened. It only produces a "Running Template" popup that does not disappear.

@windingwind
Copy link
Owner

Sorry I forgot to delete this part:
image

Does this works for you?

${await new Promise(async (r) => {
  async function getAnnotation(item) {
    try {
      if (!item || !item.isAnnotation()) {
        return null;
      }
      let json = await Zotero.Annotations.toJSON(item);
      json.id = item.key;
      delete json.key;
      for (let key in json) {
        json[key] = json[key] || "";
      }
      json.tags = json.tags || [];
      return json;
    } catch (e) {
      Zotero.logError(e);
      return null;
    }
  }

  async function getAnnotationsByColor(_item, colorFilter) {
    const annots = _item.getAnnotations().filter(colorFilter);
    if (annots.length === 0) {
      return {
        html: "",
      };
    }
    let annotations = [];
    for (let annot of annots) {
      const annotJson = await getAnnotation(annot);
      annotJson.attachmentItemID = _item.id;
      annotations.push(annotJson);
    }

    if (!editor) {
      alert("No active note editor detected. Please open workspace.");
      return r("");
    }
    await editor.importImages(annotations);
    return Zotero.EditorInstanceUtilities.serializeAnnotations(annotations);
  }

  const attachments = Zotero.Items.get(topItem.getAttachments()).filter((i) =>
    i.isPDFAttachment()
  );
  let res = "";
  const colors = ["#ffd400", "#ff6666", "#5fb236", "#2ea8e5", "#a28ae5"];
  const colorNames = ["Yellow", "Red", "Green", "Blue", "Purple"];
  for (let attachment of attachments) {
    res += `<h1>${attachment.getFilename()}</h1>`;
    for (let i in colors) {
      const renderedAnnotations = (
        await getAnnotationsByColor(
          attachment,
          (_annot) => _annot.annotationColor === colors[i]
        )
      ).html;
      if (renderedAnnotations) {
        res += `<h2><p style="background-color:${colors[i]};">${colorNames[i]} Annotations</p></h2>
${renderedAnnotations}`;
      }
    }
    const renderedAnnotations = (
      await getAnnotationsByColor(
        attachment,
        (_annot) => !colors.includes(_annot.annotationColor)
      )
    ).html;
    if (renderedAnnotations) {
      res += `<h2><p>Other Annotations</p></h2>
${renderedAnnotations}`;
    }
  }
  r(res);
})}

@mjthoraval
Copy link
Author

mjthoraval commented Oct 25, 2022

I have made a copy-paste of the new code, and it is working now. Thank you.
I would prefer to have the Title of the item instead of the name of the PDF file. How can I do?
To avoid having the update manually, would it make sense to lock the templates that you provide, or validated by the community? In that case, it would avoid deleting eventual modifications by the user to these templates, and you can update them safely as needed.

Do you have the updated version also for the collect annotations by tag template?

@windingwind
Copy link
Owner

To avoid having the update manually, would it make sense to lock the templates that you provide, or validated by the community?

I do this for system templates(marked yellow). They cannot be removed, you can only reset them.

When updating system templates, I use another name, like QuickNoteV2 to QuickNoteV3 in case user have important modifications on them.

Other templates are not related to the core functions, so they can be deleted.

Do you have the updated version also for the collect annotations by tag template?

Yes, I've updated it as well. Does it work?

@windingwind
Copy link
Owner

I would prefer to have the Title of the item instead of the name of the PDF file. How can I do?

Replace the res += `<h1>${attachment.getFilename()}</h1>`; with res += `<h1>${topItem.getField("title")</h1>`;
https://github.com/windingwind/zotero-better-notes/blob/master/TemplateDoc.md#title

@mjthoraval
Copy link
Author

Yes, the collect annotations by tag template is also working.
Thank you very much!

I have also tested the title with res += `<h1>${topItem.getField("title")}</h1>`;, and it is working nicely.
Thank you for the link to the documentation.

@sjgknight
Copy link

Thanks for the video, can confirm I do have the workspace open, but it still doesn't work (looks like what you had when it wasn't open @mjthoraval ).

The 'collect items by tag' function does work, but the annotations are links not pastes (and, 'no results' items are included). But both the [Item] collect annotations and notes by tag and [Item] collect item-notes by tag seperately, just give me the message popup.

In the debug I can see a few things like 'Unregistering notifier observer in notifier with id 'collectionTree_Ii'' and 'Unregistering notifier observer in notifier with id 'itemTreeView_y5'' but they're both also present for the functioning template.

Is it possible that this is because what I'm trying to do is select notes/annotations that are tagged, rather than tags on their parent items? I've tried both using the saved-search (which lets me select just my notes+parent-item), and selected everything in that library and then using the relevant tag, and neither works.

Thanks

@windingwind
Copy link
Owner

@sjgknight
I guess you might need to update the template (see #85) or the plugin. Keeping plugin the latest version solves most of the problems.

@sjgknight
Copy link

@windingwind thanks! I did upstate just before I tried this afternoon (using the inbuilt update functions not any reinstall) and the results are per above

@windingwind
Copy link
Owner

@sjgknight Could you please show me the template you are using? Copy the content from Edit-Note Template Editor.

@sjgknight
Copy link

@windingwind absolutely, it's this one (but as above, I've tried a couple of others just copy-pasting from the list of community templates).

// @beforeloop-begin
${(()=>{
sharedObj.tagRaw = prompt("Please input tags. Split with ',':", "");
return "";
})()}
// @beforeloop-end
// @default-begin
${await new Promise(async (r) => {
  async function getAnnotation(item) {
    try {
      if (!item || !item.isAnnotation()) {
        return null;
      }
      let json = await Zotero.Annotations.toJSON(item);
      json.id = item.key;
      delete json.key;
      for (let key in json) {
        json[key] = json[key] || "";
      }
      json.tags = json.tags || [];
      return json;
    } catch (e) {
      Zotero.logError(e);
      return null;
    }
  }
  async function getAnnotationsByTag(_item, tag) {
    let annots = _item.getAnnotations();
    annots = tag.length? 
      annots.filter((_annot) => _annot.getTags().map(_t=>_t.tag).includes(tag)) :
      annots;
    let annotations = [];
    for (let annot of annots) {
      const annotJson = await getAnnotation(annot);
      annotJson.attachmentItemID = _item.id;
      annotations.push(annotJson);
    }
    const editor =
      await Zotero.Knowledge4Zotero.knowledge.getWorkspaceEditorInstance();
    await editor.importImages(annotations);
    return Zotero.EditorInstanceUtilities.serializeAnnotations(annotations);
  }
  const attachments = Zotero.Items.get(topItem.getAttachments()).filter((i) =>
    i.isPDFAttachment()
  );
  let res = "";
  if(!sharedObj.tagRaw){
    return;
  }
  res += `<h1>${topItem.getField('title')}</h1>`;
  for (let attachment of attachments) {
    res += `<h2>${attachment.getFilename()}</h2>`;
    for(tag of sharedObj.tagRaw.split(',').filter(t=>t.length)){
      res += `<h3>Tag: ${tag}</h3>`;
      const tags = (await getAnnotationsByTag(attachment, tag)).html
      res += tags ? tags : "<p>No result</p>";
    }
  }
  res += `<h2>Notes</h2>`;
  const notesWithTags = `${itemNotes.filter(noteItem=>{
    for(tag of sharedObj.tagRaw.split(',').filter(t=>t.length)){
      if(noteItem.getTags().map(_t=>_t.tag).includes(tag)){
        return true;
}
}
return false;
}).map((noteItem)=>{
const noteLine = `<p style="color:red; background-color: #efe3da;">📜 Article Note:  <a href="${Zotero.Knowledge4Zotero.knowledge.getNoteLink(noteItem)
}" rel="noopener noreferrer nofollow">${noteItem.getNoteTitle()?noteItem.getNoteTitle():Zotero.Knowledge4Zotero.knowledge.getNoteLink(noteItem)}</a></p>
<p>tags: ${noteItem.getTags().map(_t=>_t.tag).join(', ')}</p>
<p> </p>`;
return noteLine;
}).join("\n")}`
res += notesWithTags  ? notesWithTags  : '<p>No result</p>'
  r(res);
})}
// @default-end

@windingwind
Copy link
Owner

@sjgknight seem like you are not using the latest template. please copy paste the updated ones from #85

@sjgknight
Copy link

@windingwind I wish that'd been it! I've checked with the updated template (thanks, I hadn't noticed these had changed), but I still get the same problem. (Btw I also just changed this line, log said previous filename function is depreciated)
res += `<h2>${attachment.attachmentFilename()}</h2>`;

Sorry this is probably a separate issue now, I'm happy to open a fresh issue and if there's anything I can do to setup something reproducible/output useful logs, I'd appreciate any help.

@windingwind
Copy link
Owner

@sjgknight
If you are using the template via menu-Edit-Insert Template, please make sure the main note (usually the workspace) is open and the main note is set and not in trash;
If you are using it via the note editor's right-click menu, please go to menu-Help-Debug Output-View Output and paste the debug log here.
Thanks!

@sjgknight
Copy link

@windingwind I've tried both ways. I'm pasting debug log for the right click approach here. I just selected everything in the library except the standalone notes. This master note/workspace is within that library. I know the tag exists on a number of notes where I have used the "add annotation to note" function.


[JavaScript Error: "Error 413 for item GNKISE52 in resp-LA:

ZoteroObjectUploadError: Note '<div data-citation-items="%5B%7B%22uris%22%3A%5B%22http%3A%2F%2Fzotero.org%2Fgr...' too long for item '10651610/GNKISE52'"]

[JavaScript Error: "Note '<div data-citation-items="%5B%7B%22uris%22%3A%5B%22http%3A%2F%2Fzotero.org%2Fgr...' too long for item '10651610/GNKISE52'" {file: "chrome://zotero/content/xpcom/sync/syncEngine.js" line: 1357}]

[JavaScript Error: "Made no progress during upload -- stopping" {file: "chrome://zotero/content/xpcom/sync/syncEngine.js" line: 1416}]

[JavaScript Error: "Made no progress during upload -- stopping" {file: "chrome://zotero/content/xpcom/sync/syncEngine.js" line: 1416}]

[JavaScript Error: "Error 413 for item ARXTVPTH in resp-LA:

ZoteroObjectUploadError: Note '<div data-citation-items="%5B%7B%22uris%22%3A%5B%22http%3A%2F%2Fzotero.org%2Fgr...' too long for item '10651610/ARXTVPTH'"]

[JavaScript Error: "Note '<div data-citation-items="%5B%7B%22uris%22%3A%5B%22http%3A%2F%2Fzotero.org%2Fgr...' too long for item '10651610/ARXTVPTH'" {file: "chrome://zotero/content/xpcom/sync/syncEngine.js" line: 1357}]

[JavaScript Error: "Error 413 for item GNKISE52 in resp-LA:

ZoteroObjectUploadError: Note '<div data-citation-items="%5B%7B%22uris%22%3A%5B%22http%3A%2F%2Fzotero.org%2Fgr...' too long for item '10651610/GNKISE52'"]

[JavaScript Error: "Note '<div data-citation-items="%5B%7B%22uris%22%3A%5B%22http%3A%2F%2Fzotero.org%2Fgr...' too long for item '10651610/GNKISE52'" {file: "chrome://zotero/content/xpcom/sync/syncEngine.js" line: 1357}]

[JavaScript Error: "Made no progress during upload -- stopping" {file: "chrome://zotero/content/xpcom/sync/syncEngine.js" line: 1416}]

[JavaScript Error: "Made no progress during upload -- stopping" {file: "chrome://zotero/content/xpcom/sync/syncEngine.js" line: 1416}]

[JavaScript Error: "Error 413 for item ARXTVPTH in resp-LA:

ZoteroObjectUploadError: Note '<div data-citation-items="%5B%7B%22uris%22%3A%5B%22http%3A%2F%2Fzotero.org%2Fgr...' too long for item '10651610/ARXTVPTH'"]

[JavaScript Error: "Note '<div data-citation-items="%5B%7B%22uris%22%3A%5B%22http%3A%2F%2Fzotero.org%2Fgr...' too long for item '10651610/ARXTVPTH'" {file: "chrome://zotero/content/xpcom/sync/syncEngine.js" line: 1357}]

[JavaScript Error: "Error 413 for item GNKISE52 in resp-LA:

ZoteroObjectUploadError: Note '<div data-citation-items="%5B%7B%22uris%22%3A%5B%22http%3A%2F%2Fzotero.org%2Fgr...' too long for item '10651610/GNKISE52'"]

[JavaScript Error: "Note '<div data-citation-items="%5B%7B%22uris%22%3A%5B%22http%3A%2F%2Fzotero.org%2Fgr...' too long for item '10651610/GNKISE52'" {file: "chrome://zotero/content/xpcom/sync/syncEngine.js" line: 1357}]

[JavaScript Error: "Error 413 for item ARXTVPTH in resp-LA:

ZoteroObjectUploadError: Note '<div data-citation-items="%5B%7B%22uris%22%3A%5B%22http%3A%2F%2Fzotero.org%2Fgr...' too long for item '10651610/ARXTVPTH'"]

[JavaScript Error: "Note '<div data-citation-items="%5B%7B%22uris%22%3A%5B%22http%3A%2F%2Fzotero.org%2Fgr...' too long for item '10651610/ARXTVPTH'" {file: "chrome://zotero/content/xpcom/sync/syncEngine.js" line: 1357}]

[JavaScript Error: "Error 413 for item GNKISE52 in resp-LA:

ZoteroObjectUploadError: Note '<div data-citation-items="%5B%7B%22uris%22%3A%5B%22http%3A%2F%2Fzotero.org%2Fgr...' too long for item '10651610/GNKISE52'"]

[JavaScript Error: "Note '<div data-citation-items="%5B%7B%22uris%22%3A%5B%22http%3A%2F%2Fzotero.org%2Fgr...' too long for item '10651610/GNKISE52'" {file: "chrome://zotero/content/xpcom/sync/syncEngine.js" line: 1357}]

[JavaScript Error: "Error 413 for item ARXTVPTH in resp-LA:

ZoteroObjectUploadError: Note '<div data-citation-items="%5B%7B%22uris%22%3A%5B%22http%3A%2F%2Fzotero.org%2Fgr...' too long for item '10651610/ARXTVPTH'"]

[JavaScript Error: "Note '<div data-citation-items="%5B%7B%22uris%22%3A%5B%22http%3A%2F%2Fzotero.org%2Fgr...' too long for item '10651610/ARXTVPTH'" {file: "chrome://zotero/content/xpcom/sync/syncEngine.js" line: 1357}]

[JavaScript Error: "Error 413 for item GNKISE52 in resp-LA:

ZoteroObjectUploadError: Note '<div data-citation-items="%5B%7B%22uris%22%3A%5B%22http%3A%2F%2Fzotero.org%2Fgr...' too long for item '10651610/GNKISE52'"]

[JavaScript Error: "Note '<div data-citation-items="%5B%7B%22uris%22%3A%5B%22http%3A%2F%2Fzotero.org%2Fgr...' too long for item '10651610/GNKISE52'" {file: "chrome://zotero/content/xpcom/sync/syncEngine.js" line: 1357}]

[JavaScript Error: "Made no progress during upload -- stopping" {file: "chrome://zotero/content/xpcom/sync/syncEngine.js" line: 1416}]

[JavaScript Error: "Made no progress during upload -- stopping" {file: "chrome://zotero/content/xpcom/sync/syncEngine.js" line: 1416}]

[JavaScript Error: "TypeError: attachment.attachmentFilename is not a function" {file: "chrome://knowledge4zotero/content/scripts/index.js line 47518 > AsyncFunction" line: 49}]

version => 6.0.16-beta.8+c5a769285, platform => Win32, oscpu => Windows NT 10.0; WOW64, locale => en-US, appName => Zotero, appVersion => 6.0.16-beta.8+c5a769285, extensions => DOI Manager (1.4.2, extension), Zotero Report Customizer (5.0.38, extension), Zotero Voyant Export (0.0.4, extension), Zutilo Utility for Zotero (3.10.0, extension), Mdnotes for Zotero (0.1.3, extension), scite Plugin for Zotero (1.11.6, extension), ODF Scan for Zotero (2.0.48, extension), ZotFile (5.1.2, extension), Zotero Better Notes (0.7.16, extension), Better BibTex for Zotero (6.7.29, extension), Zotero LibreOffice Integration (6.0.3.SA.6.0.16-beta.8+c5a769285, extension), Zotero Word for Windows Integration (6.0.2.SA.6.0.16-beta.8+c5a769285, extension), Cita (0.4.0, extension), Shockwave Flash (32.0.0.465, plugin), Zotero Scholar Citations (1.9.3, extension, disabled)

(3)(+0014748): itemTree.render(). Displaying Item Tree

(3)(+0001754): ===>227<=== (number)

(3)(+0003848): ===>227<=== (number)

(3)(+0000180): Knowledge4Zotero: onEditorEvent openWorkspace

(3)(+0000000): openWorkspaceWindow: focus

(3)(+0000005): Notifier.trigger('select', 'tab', [tab-XnFxPv5B], {"tab-XnFxPv5B":{"type":"betternotes"}}) called [observers: 5]

(3)(+0000002): updateWordCount

(3)(+0000206): itemTree.render(). Displaying Item Tree

(3)(+0004293): Knowledge4Zotero: line 1 selected.

(3)(+0000000): Current Element: <p><br class="ProseMirror-trailingBreak"></p>; Real Element: <div translate="no" class="ProseMirror primary-editor ProseMirror-focused" contenteditable="true"><h1>hello world</h1><p><br class="ProseMirror-trailingBreak"></p><p><br class="ProseMirror-trailingBreak"></p></div>

(3)(+0000000): Knowledge4Zotero: line 1 selected.

(3)(+0000000): Current Element: <p><br class="ProseMirror-trailingBreak"></p>; Real Element: <div translate="no" class="ProseMirror primary-editor ProseMirror-focused" contenteditable="true"><h1>hello world</h1><p><br class="ProseMirror-trailingBreak"></p><p><br class="ProseMirror-trailingBreak"></p></div>

(3)(+0000000): Knowledge4Zotero: line 1 selected.

(3)(+0000000): Current Element: <p><br class="ProseMirror-trailingBreak"></p>; Real Element: <div translate="no" class="ProseMirror primary-editor ProseMirror-focused" contenteditable="true"><h1>hello world</h1><p><br class="ProseMirror-trailingBreak"></p><p><br class="ProseMirror-trailingBreak"></p></div>

(3)(+0003814): updateTemplateMenu

(3)(+0000496): updateTemplateMenu

(3)(+0003776): Knowledge4Zotero: onEditorEvent insertItemUsingTemplate

(3)(+0000100): Initializing React ItemTree select-items-dialog

(3)(+0000005): itemTree.render(). Displaying Item Pane Message

(3)(+0000002): React ItemTree select-items-dialog initialized

(3)(+0000001): itemTree.render(). Displaying Item Pane Message

(3)(+0000002): Initializing React CollectionTree

(3)(+0000009): Refreshing collections pane

(4)(+0000002): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [1]

(3)(+0000000): React CollectionTree initialized

(3)(+0000000): Refreshing collections pane

(4)(+0000002): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [1]

(4)(+0000068): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743775]

(4)(+0000010): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743775]

(4)(+0000007): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743777]

(4)(+0000002): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743777]

(4)(+0000001): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743772]

(4)(+0000000): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743772]

(4)(+0000001): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743776]

(4)(+0000000): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743776]

(4)(+0000001): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743771]

(4)(+0000002): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743771]

(4)(+0000001): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743778]

(4)(+0000001): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743778]

(4)(+0000002): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743773]

(4)(+0000001): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743773]

(4)(+0000000): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743767]

(4)(+0000001): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743767]

(4)(+0000001): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743774]

(4)(+0000001): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743774]

(4)(+0000000): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743779]

(4)(+0000002): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743779]

(4)(+0000000): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743770]

(4)(+0000001): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743770]

(4)(+0000002): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743769]

(4)(+0000003): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743769]

(3)(+0000032): CollectionTree.selectWait(): selectEventsSuppressed. Not waiting to select row 147

(3)(+0000019): CollectionTree.selectWait(): row 147 already selected

(3)(+0000110): itemTree.changeCollectionTreeRow(): L2743770

(3)(+0000000): Getting contents of C:\Users\125295_admin\AppData\Roaming\Zotero\Zotero\Profiles\3qsij9ns.default\treePrefs.json

(3)(+0000003): Writing column prefs of length 6808 to file C:\Users\125295_admin\AppData\Roaming\Zotero\Zotero\Profiles\3qsij9ns.default\treePrefs.json

(3)(+0000004): Getting contents of C:\Users\125295_admin\AppData\Roaming\Zotero\Zotero\Profiles\3qsij9ns.default\treePrefs.json

(3)(+0000007): Refreshing items list for item-tree-select-items-dialog-default

(4)(+0000002): CREATE TEMPORARY TABLE tmpSearchResults_9H5TKph5 AS SELECT COALESCE(IA.parentItemID, itemID) AS itemID FROM items LEFT JOIN itemAnnotations IA USING (itemID) WHERE (itemID NOT IN (SELECT itemID FROM deletedItems) AND itemID NOT IN (SELECT itemID FROM itemNotes WHERE parentItemID IS NOT NULL AND parentItemID IN (SELECT itemID FROM deletedItems)) AND itemID NOT IN (SELECT itemID FROM itemAttachments WHERE parentItemID IS NOT NULL AND parentItemID IN (SELECT itemID FROM deletedItems))) AND (itemID NOT IN (SELECT itemID FROM itemNotes WHERE parentItemID IS NOT NULL) AND itemID NOT IN (SELECT itemID FROM itemAttachments WHERE parentItemID IS NOT NULL)) AND itemID IN (SELECT itemID FROM items WHERE (libraryID=?)) [2743770]

(4)(+0000013): CREATE INDEX tmpSearchResults_9H5TKph5_itemID ON tmpSearchResults_9H5TKph5(itemID)

(4)(+0000001): SELECT GROUP_CONCAT(itemID) FROM items WHERE itemID IN (SELECT COALESCE(IA.parentItemID, itemID) AS itemID FROM items LEFT JOIN itemAnnotations IA USING (itemID) WHERE (itemID NOT IN (SELECT itemID FROM deletedItems) AND itemID NOT IN (SELECT itemID FROM itemNotes WHERE parentItemID IS NOT NULL AND parentItemID IN (SELECT itemID FROM deletedItems)) AND itemID NOT IN (SELECT itemID FROM itemAttachments WHERE parentItemID IS NOT NULL AND parentItemID IN (SELECT itemID FROM deletedItems))) AND itemID IN (SELECT itemID FROM items WHERE (libraryID=?))) AND (itemID IN (SELECT itemID FROM tmpSearchResults_9H5TKph5) OR itemID IN (SELECT itemID FROM itemAttachments WHERE parentItemID IN (SELECT itemID FROM tmpSearchResults_9H5TKph5)) OR itemID IN (SELECT itemID FROM itemNotes WHERE parentItemID IN (SELECT itemID FROM tmpSearchResults_9H5TKph5))) [2743770]

(4)(+0000007): DROP TABLE IF EXISTS tmpSearchResults_9H5TKph5

(3)(+0000030): Sorting items list by itemType, year, firstCreator, title, dateAdded ascending for 996 items

(3)(+0000099): Sorted 996 items in 103 ms

(3)(+0000003): Refreshed open parents in 3 ms

(3)(+0000005): itemTree.render(). Displaying Item Tree

(2)(+0000006): Storing itemTree item-tree-select-items-dialog-default column prefs

(3)(+0000000): Columns title width 263

(3)(+0000000): Columns firstCreator width 114

(3)(+0000000): Columns itemType width 103

(3)(+0000072): itemTree.render(). Displaying Item Tree

(3)(+0000024): itemTree.render(). Displaying Item Tree

(3)(+0000008): React CollectionTree loaded

(3)(+0000000): React CollectionTree loaded

(3)(+0003934): itemTree.render(). Displaying Item Tree

(3)(+0004604): itemTree.render(). Displaying Item Tree

(4)(+0002151): Unregistering notifier observer in notifier with id 'collectionTree_iA'

(4)(+0000001): Unregistering notifier observer in notifier with id 'itemTreeView_to'

(3)(+0000000): Getting contents of C:\Users\125295_admin\AppData\Roaming\Zotero\Zotero\Profiles\3qsij9ns.default\treePrefs.json

(3)(+0000006): renderTemplateAsync: [Item] v3 collect annotations and notes by tag

(3)(+0000013): Writing column prefs of length 6808 to file C:\Users\125295_admin\AppData\Roaming\Zotero\Zotero\Profiles\3qsij9ns.default\treePrefs.json

(3)(+0007101): renderTemplateAsync: [Item] v3 collect annotations and notes by tag

(3)(+0000002): renderTemplateAsync: [Item] v3 collect annotations and notes by tag

(3)(+0000001): renderTemplateAsync: [Item] v3 collect annotations and notes by tag

(3)(+0000001): renderTemplateAsync: [Item] v3 collect annotations and notes by tag

(3)(+0000001): renderTemplateAsync: [Item] v3 collect annotations and notes by tag

(3)(+0000001): renderTemplateAsync: [Item] v3 collect annotations and notes by tag

(3)(+0000000): renderTemplateAsync: [Item] v3 collect annotations and notes by tag

(3)(+0000001): renderTemplateAsync: [Item] v3 collect annotations and notes by tag

(3)(+0000001): renderTemplateAsync: [Item] v3 collect annotations and notes by tag

(3)(+0000001): renderTemplateAsync: [Item] v3 collect annotations and notes by tag

(3)(+0000001): renderTemplateAsync: [Item] v3 collect annotations and notes by tag

(3)(+0000001): renderTemplateAsync: [Item] v3 collect annotations and notes by tag

(3)(+0000001): renderTemplateAsync: [Item] v3 collect annotations and notes by tag

(3)(+0000001): renderTemplateAsync: [Item] v3 collect annotations and notes by tag

(3)(+0000000): renderTemplateAsync: [Item] v3 collect annotations and notes by tag

(3)(+0000001): renderTemplateAsync: [Item] v3 collect annotations and notes by tag

(3)(+0004876): ===>227<=== (number)

@windingwind
Copy link
Owner

@sjgknight seem like you have directly selected pdf attachments, rather than Zotero items. Could you please check if it works when only Zotero items(item with metadata) selected?

@sjgknight
Copy link

@windingwind I'm not selecting pdf attachments (except indirectly maybe), the annotations are all in notes attached to items, and the notes themselves are tagged (but not the parent items). I just ran it again with 1 parent item selected where I know there is an attached note with the relevant tag.


[JavaScript Error: "HTTP POST https://repo.zotero.org/repo/updated?last=1666834522&version=6.0.16-beta.8+c5a769285&m=4 failed with status code 504:

<html>

<head><title>504 Gateway Time-out</title></head>

<body>

<center><h1>504 Gateway Time-out</h1></center>

</body>

</html>

"]

[JavaScript Error: "The connection to wss://stream.zotero.org/ has terminated unexpectedly. Some data may have been transferred."]

[JavaScript Error: "WebSocket connection closed: 1006 "]

[JavaScript Error: "Error 413 for item GNKISE52 in resp-LA:

ZoteroObjectUploadError: Note '<div data-citation-items="%5B%7B%22uris%22%3A%5B%22http%3A%2F%2Fzotero.org%2Fgr...' too long for item '10651610/GNKISE52'"]

[JavaScript Error: "Note '<div data-citation-items="%5B%7B%22uris%22%3A%5B%22http%3A%2F%2Fzotero.org%2Fgr...' too long for item '10651610/GNKISE52'" {file: "chrome://zotero/content/xpcom/sync/syncEngine.js" line: 1357}]

[JavaScript Error: "Made no progress during upload -- stopping" {file: "chrome://zotero/content/xpcom/sync/syncEngine.js" line: 1416}]

[JavaScript Error: "Made no progress during upload -- stopping" {file: "chrome://zotero/content/xpcom/sync/syncEngine.js" line: 1416}]

[JavaScript Error: "The connection to wss://stream.zotero.org/ has terminated unexpectedly. Some data may have been transferred."]

[JavaScript Error: "WebSocket connection closed: 1006 "]

[JavaScript Error: "The connection to wss://stream.zotero.org/ has terminated unexpectedly. Some data may have been transferred."]

[JavaScript Error: "WebSocket connection closed: 1006 "]

[JavaScript Error: "S3 returned 0 for 2743773/22W5839A -- retrying download" {file: "chrome://zotero/content/xpcom/storage/zfs.js" line: 180}]
Zotero.Sync.Storage.Mode.ZFS.prototype.downloadFile</listener<.onStop<@chrome://zotero/content/xpcom/storage/zfs.js:180:15
_onStop@chrome://zotero/content/xpcom/storage/streamListener.js:242:9
onStateChange@chrome://zotero/content/xpcom/storage/streamListener.js:119:9


[JavaScript Error: "S3 returned 0 for 2743773/248H6T6U -- retrying download" {file: "chrome://zotero/content/xpcom/storage/zfs.js" line: 180}]
Zotero.Sync.Storage.Mode.ZFS.prototype.downloadFile</listener<.onStop<@chrome://zotero/content/xpcom/storage/zfs.js:180:15
_onStop@chrome://zotero/content/xpcom/storage/streamListener.js:242:9
onStateChange@chrome://zotero/content/xpcom/storage/streamListener.js:119:9


[JavaScript Error: "S3 returned 0 for 2743773/2DNFHQW2 -- retrying download" {file: "chrome://zotero/content/xpcom/storage/zfs.js" line: 180}]
Zotero.Sync.Storage.Mode.ZFS.prototype.downloadFile</listener<.onStop<@chrome://zotero/content/xpcom/storage/zfs.js:180:15
_onStop@chrome://zotero/content/xpcom/storage/streamListener.js:242:9
onStateChange@chrome://zotero/content/xpcom/storage/streamListener.js:119:9


[JavaScript Error: "S3 returned 0 for 2743773/2G4263MG -- retrying download" {file: "chrome://zotero/content/xpcom/storage/zfs.js" line: 180}]
Zotero.Sync.Storage.Mode.ZFS.prototype.downloadFile</listener<.onStop<@chrome://zotero/content/xpcom/storage/zfs.js:180:15
_onStop@chrome://zotero/content/xpcom/storage/streamListener.js:242:9
onStateChange@chrome://zotero/content/xpcom/storage/streamListener.js:119:9


[JavaScript Error: "TypeError: attachment.attachmentFilename is not a function" {file: "chrome://knowledge4zotero/content/scripts/index.js line 47518 > AsyncFunction" line: 49}]

[JavaScript Error: "TypeError: attachment.attachmentFilename is not a function" {file: "chrome://knowledge4zotero/content/scripts/index.js line 47518 > AsyncFunction" line: 49}]

version => 6.0.16-beta.8+c5a769285, platform => Win32, oscpu => Windows NT 10.0; WOW64, locale => en-US, appName => Zotero, appVersion => 6.0.16-beta.8+c5a769285, extensions => DOI Manager (1.4.2, extension), Zotero Report Customizer (5.0.38, extension), Zotero Voyant Export (0.0.4, extension), Zutilo Utility for Zotero (3.10.0, extension), Mdnotes for Zotero (0.1.3, extension), scite Plugin for Zotero (1.11.6, extension), ODF Scan for Zotero (2.0.48, extension), ZotFile (5.1.2, extension), Zotero Better Notes (0.7.16, extension), Better BibTex for Zotero (6.7.29, extension), Zotero LibreOffice Integration (6.0.3.SA.6.0.16-beta.8+c5a769285, extension), Zotero Word for Windows Integration (6.0.2.SA.6.0.16-beta.8+c5a769285, extension), Cita (0.4.0, extension), Shockwave Flash (32.0.0.465, plugin), Zotero Scholar Citations (1.9.3, extension, disabled)

(3)(+0012386): updateTemplateMenu

(3)(+0002166): Knowledge4Zotero: onEditorEvent insertItemUsingTemplate

(3)(+0000052): Initializing React ItemTree select-items-dialog

(3)(+0000004): itemTree.render(). Displaying Item Pane Message

(3)(+0000002): React ItemTree select-items-dialog initialized

(3)(+0000001): itemTree.render(). Displaying Item Pane Message

(3)(+0000002): Initializing React CollectionTree

(3)(+0000011): Refreshing collections pane

(4)(+0000002): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [1]

(3)(+0000000): React CollectionTree initialized

(3)(+0000000): Refreshing collections pane

(4)(+0000002): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [1]

(4)(+0000124): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743775]

(4)(+0000013): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743775]

(4)(+0000014): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743777]

(4)(+0000002): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743777]

(4)(+0000003): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743772]

(4)(+0000003): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743772]

(4)(+0000001): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743776]

(4)(+0000000): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743776]

(4)(+0000002): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743771]

(4)(+0000002): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743771]

(4)(+0000001): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743778]

(4)(+0000000): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743778]

(4)(+0000001): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743773]

(4)(+0000001): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743773]

(4)(+0000000): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743767]

(4)(+0000001): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743767]

(4)(+0000001): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743774]

(4)(+0000000): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743774]

(4)(+0000002): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743779]

(4)(+0000002): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743779]

(4)(+0000002): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743770]

(4)(+0000000): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743770]

(4)(+0000002): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743769]

(4)(+0000003): SELECT savedSearchID FROM savedSearches WHERE libraryID=? [2743769]

(3)(+0000032): CollectionTree.selectWait(): selectEventsSuppressed. Not waiting to select row 147

(3)(+0000019): CollectionTree.selectWait(): row 147 already selected

(3)(+0000103): itemTree.changeCollectionTreeRow(): L2743770

(3)(+0000001): Getting contents of C:\Users\125295_admin\AppData\Roaming\Zotero\Zotero\Profiles\3qsij9ns.default\treePrefs.json

(3)(+0000001): Writing column prefs of length 6807 to file C:\Users\125295_admin\AppData\Roaming\Zotero\Zotero\Profiles\3qsij9ns.default\treePrefs.json

(3)(+0000004): Getting contents of C:\Users\125295_admin\AppData\Roaming\Zotero\Zotero\Profiles\3qsij9ns.default\treePrefs.json

(3)(+0000003): Refreshing items list for item-tree-select-items-dialog-default

(4)(+0000005): CREATE TEMPORARY TABLE tmpSearchResults_WI83WZB7 AS SELECT COALESCE(IA.parentItemID, itemID) AS itemID FROM items LEFT JOIN itemAnnotations IA USING (itemID) WHERE (itemID NOT IN (SELECT itemID FROM deletedItems) AND itemID NOT IN (SELECT itemID FROM itemNotes WHERE parentItemID IS NOT NULL AND parentItemID IN (SELECT itemID FROM deletedItems)) AND itemID NOT IN (SELECT itemID FROM itemAttachments WHERE parentItemID IS NOT NULL AND parentItemID IN (SELECT itemID FROM deletedItems))) AND (itemID NOT IN (SELECT itemID FROM itemNotes WHERE parentItemID IS NOT NULL) AND itemID NOT IN (SELECT itemID FROM itemAttachments WHERE parentItemID IS NOT NULL)) AND itemID IN (SELECT itemID FROM items WHERE (libraryID=?)) [2743770]

(4)(+0000014): CREATE INDEX tmpSearchResults_WI83WZB7_itemID ON tmpSearchResults_WI83WZB7(itemID)

(4)(+0000001): SELECT GROUP_CONCAT(itemID) FROM items WHERE itemID IN (SELECT COALESCE(IA.parentItemID, itemID) AS itemID FROM items LEFT JOIN itemAnnotations IA USING (itemID) WHERE (itemID NOT IN (SELECT itemID FROM deletedItems) AND itemID NOT IN (SELECT itemID FROM itemNotes WHERE parentItemID IS NOT NULL AND parentItemID IN (SELECT itemID FROM deletedItems)) AND itemID NOT IN (SELECT itemID FROM itemAttachments WHERE parentItemID IS NOT NULL AND parentItemID IN (SELECT itemID FROM deletedItems))) AND itemID IN (SELECT itemID FROM items WHERE (libraryID=?))) AND (itemID IN (SELECT itemID FROM tmpSearchResults_WI83WZB7) OR itemID IN (SELECT itemID FROM itemAttachments WHERE parentItemID IN (SELECT itemID FROM tmpSearchResults_WI83WZB7)) OR itemID IN (SELECT itemID FROM itemNotes WHERE parentItemID IN (SELECT itemID FROM tmpSearchResults_WI83WZB7))) [2743770]

(4)(+0000009): DROP TABLE IF EXISTS tmpSearchResults_WI83WZB7

(3)(+0000037): Sorting items list by title, firstCreator, date, dateAdded ascending for 996 items

(3)(+0000035): Sorted 996 items in 40 ms

(3)(+0000004): Refreshed open parents in 4 ms

(3)(+0000005): itemTree.render(). Displaying Item Tree

(2)(+0000005): Storing itemTree item-tree-select-items-dialog-default column prefs

(3)(+0000000): Columns title width 263

(3)(+0000000): Columns firstCreator width 114

(3)(+0000001): Columns itemType width 103

(3)(+0000082): itemTree.render(). Displaying Item Tree

(3)(+0000025): itemTree.render(). Displaying Item Tree

(3)(+0000007): React CollectionTree loaded

(3)(+0000000): React CollectionTree loaded

(3)(+0004828): Refreshing items list for item-tree-select-items-dialog-default

(4)(+0000012): CREATE TEMPORARY TABLE tmpSearchResults_HAP7dF9Z AS SELECT COALESCE(IA.parentItemID, itemID) AS itemID FROM items LEFT JOIN itemAnnotations IA USING (itemID) WHERE (itemID NOT IN (SELECT itemID FROM deletedItems) AND itemID NOT IN (SELECT itemID FROM itemNotes WHERE parentItemID IS NOT NULL AND parentItemID IN (SELECT itemID FROM deletedItems)) AND itemID NOT IN (SELECT itemID FROM itemAttachments WHERE parentItemID IS NOT NULL AND parentItemID IN (SELECT itemID FROM deletedItems))) AND (itemID NOT IN (SELECT itemID FROM itemNotes WHERE parentItemID IS NOT NULL) AND itemID NOT IN (SELECT itemID FROM itemAttachments WHERE parentItemID IS NOT NULL)) AND itemID IN (SELECT itemID FROM items WHERE (libraryID=?)) [2743770]

(4)(+0000013): CREATE INDEX tmpSearchResults_HAP7dF9Z_itemID ON tmpSearchResults_HAP7dF9Z(itemID)

(4)(+0000002): SELECT GROUP_CONCAT(itemID) FROM items WHERE itemID IN (SELECT COALESCE(IAn.parentItemID, itemID) AS itemID FROM items LEFT JOIN itemAnnotations IAn USING (itemID) WHERE itemID IN (SELECT COALESCE(IA.parentItemID, itemID) AS itemID FROM items LEFT JOIN itemAnnotations IA USING (itemID) WHERE (itemID NOT IN (SELECT itemID FROM deletedItems) AND itemID NOT IN (SELECT itemID FROM itemNotes WHERE parentItemID IS NOT NULL AND parentItemID IN (SELECT itemID FROM deletedItems)) AND itemID NOT IN (SELECT itemID FROM itemAttachments WHERE parentItemID IS NOT NULL AND parentItemID IN (SELECT itemID FROM deletedItems))) AND (itemID NOT IN (SELECT itemID FROM itemNotes WHERE parentItemID IS NOT NULL) AND itemID NOT IN (SELECT itemID FROM itemAttachments WHERE parentItemID IS NOT NULL)) AND itemID IN (SELECT itemID FROM items WHERE (libraryID=?))) AND ((itemID IN (SELECT itemID FROM itemData WHERE (fieldID IN (?,?,?,?) AND valueID IN (SELECT valueID FROM itemDataValues WHERE value LIKE ?))) OR itemID IN (SELECT itemID FROM itemData WHERE (fieldID IN (?,?,?,?,?,?,?,?,?,?) AND valueID IN (SELECT valueID FROM itemDataValues WHERE value LIKE ?))) OR itemID IN (SELECT itemID FROM itemData WHERE (fieldID=? AND valueID IN (SELECT valueID FROM itemDataValues WHERE value LIKE ?))) OR itemID IN (SELECT itemID FROM itemData WHERE (fieldID=? AND valueID IN (SELECT valueID FROM itemDataValues WHERE value LIKE ?))) OR itemID IN (SELECT itemID FROM itemData WHERE (fieldID IN (?,?,?,?) AND valueID IN (SELECT valueID FROM itemDataValues WHERE SUBSTR(value, 1, 4) LIKE ?))) OR itemID IN (SELECT itemID FROM betterbibtexsearch.citekeys WHERE (citekey LIKE ?)) OR itemID IN (SELECT itemID FROM itemCreators WHERE (creatorID IN (SELECT creatorID FROM creators WHERE TRIM(firstName || ' ' || lastName) LIKE ?)))))) AND (itemID IN (SELECT itemID FROM tmpSearchResults_HAP7dF9Z) OR itemID IN (SELECT itemID FROM itemAttachments WHERE parentItemID IN (SELECT itemID FROM tmpSearchResults_HAP7dF9Z)) OR itemID IN (SELECT itemID FROM itemNotes WHERE parentItemID IN (SELECT itemID FROM tmpSearchResults_HAP7dF9Z))) [2743770, 110, 111, 112, 113, '%elephant%', 12, 115, 91, 107, 104, 119, 119, 114, 85, 86, '%elephant%', 116, '%elephant%', 44, '%elephant%', 14, 96, 52, 100, '%elephant%', '%elephant%', '%elephant%']

(4)(+0001655): DROP TABLE IF EXISTS tmpSearchResults_HAP7dF9Z

(3)(+0000004): Refreshed open parents in 0 ms

(3)(+0000001): Refreshing items list for item-tree-select-items-dialog-default

(3)(+0000004): itemTree.render(). Displaying Item Tree

(3)(+0000035): itemTree.render(). Displaying Item Tree

(4)(+0000008): CREATE TEMPORARY TABLE tmpSearchResults_SlITa5gz AS SELECT COALESCE(IA.parentItemID, itemID) AS itemID FROM items LEFT JOIN itemAnnotations IA USING (itemID) WHERE (itemID NOT IN (SELECT itemID FROM deletedItems) AND itemID NOT IN (SELECT itemID FROM itemNotes WHERE parentItemID IS NOT NULL AND parentItemID IN (SELECT itemID FROM deletedItems)) AND itemID NOT IN (SELECT itemID FROM itemAttachments WHERE parentItemID IS NOT NULL AND parentItemID IN (SELECT itemID FROM deletedItems))) AND (itemID NOT IN (SELECT itemID FROM itemNotes WHERE parentItemID IS NOT NULL) AND itemID NOT IN (SELECT itemID FROM itemAttachments WHERE parentItemID IS NOT NULL)) AND itemID IN (SELECT itemID FROM items WHERE (libraryID=?)) [2743770]

(4)(+0000014): CREATE INDEX tmpSearchResults_SlITa5gz_itemID ON tmpSearchResults_SlITa5gz(itemID)

(4)(+0000002): SELECT GROUP_CONCAT(itemID) FROM items WHERE itemID IN (SELECT COALESCE(IAn.parentItemID, itemID) AS itemID FROM items LEFT JOIN itemAnnotations IAn USING (itemID) WHERE itemID IN (SELECT COALESCE(IA.parentItemID, itemID) AS itemID FROM items LEFT JOIN itemAnnotations IA USING (itemID) WHERE (itemID NOT IN (SELECT itemID FROM deletedItems) AND itemID NOT IN (SELECT itemID FROM itemNotes WHERE parentItemID IS NOT NULL AND parentItemID IN (SELECT itemID FROM deletedItems)) AND itemID NOT IN (SELECT itemID FROM itemAttachments WHERE parentItemID IS NOT NULL AND parentItemID IN (SELECT itemID FROM deletedItems))) AND (itemID NOT IN (SELECT itemID FROM itemNotes WHERE parentItemID IS NOT NULL) AND itemID NOT IN (SELECT itemID FROM itemAttachments WHERE parentItemID IS NOT NULL)) AND itemID IN (SELECT itemID FROM items WHERE (libraryID=?))) AND ((itemID IN (SELECT itemID FROM itemData WHERE (fieldID IN (?,?,?,?) AND valueID IN (SELECT valueID FROM itemDataValues WHERE value LIKE ?))) OR itemID IN (SELECT itemID FROM itemData WHERE (fieldID IN (?,?,?,?,?,?,?,?,?,?) AND valueID IN (SELECT valueID FROM itemDataValues WHERE value LIKE ?))) OR itemID IN (SELECT itemID FROM itemData WHERE (fieldID=? AND valueID IN (SELECT valueID FROM itemDataValues WHERE value LIKE ?))) OR itemID IN (SELECT itemID FROM itemData WHERE (fieldID=? AND valueID IN (SELECT valueID FROM itemDataValues WHERE value LIKE ?))) OR itemID IN (SELECT itemID FROM itemData WHERE (fieldID IN (?,?,?,?) AND valueID IN (SELECT valueID FROM itemDataValues WHERE SUBSTR(value, 1, 4) LIKE ?))) OR itemID IN (SELECT itemID FROM betterbibtexsearch.citekeys WHERE (citekey LIKE ?)) OR itemID IN (SELECT itemID FROM itemCreators WHERE (creatorID IN (SELECT creatorID FROM creators WHERE TRIM(firstName || ' ' || lastName) LIKE ?)))))) AND (itemID IN (SELECT itemID FROM tmpSearchResults_SlITa5gz) OR itemID IN (SELECT itemID FROM itemAttachments WHERE parentItemID IN (SELECT itemID FROM tmpSearchResults_SlITa5gz)) OR itemID IN (SELECT itemID FROM itemNotes WHERE parentItemID IN (SELECT itemID FROM tmpSearchResults_SlITa5gz))) [2743770, 110, 111, 112, 113, '%elephant%', 12, 115, 91, 107, 104, 119, 119, 114, 85, 86, '%elephant%', 116, '%elephant%', 44, '%elephant%', 14, 96, 52, 100, '%elephant%', '%elephant%', '%elephant%']

(3)(+0001596): itemTree.render(). Displaying Item Tree

(4)(+0000101): DROP TABLE IF EXISTS tmpSearchResults_SlITa5gz

(3)(+0000002): Refreshed open parents in 0 ms

(3)(+0000002): itemTree.render(). Displaying Item Tree

(3)(+0000014): itemTree.render(). Displaying Item Tree

(3)(+0000012): itemTree.render(). Displaying Item Tree

(4)(+0002478): Unregistering notifier observer in notifier with id 'collectionTree_vw'

(4)(+0000000): Unregistering notifier observer in notifier with id 'itemTreeView_7u'

(3)(+0000001): Getting contents of C:\Users\125295_admin\AppData\Roaming\Zotero\Zotero\Profiles\3qsij9ns.default\treePrefs.json

(3)(+0000005): renderTemplateAsync: [Item] v3 collect annotations and notes by tag

(3)(+0000012): Writing column prefs of length 6807 to file C:\Users\125295_admin\AppData\Roaming\Zotero\Zotero\Profiles\3qsij9ns.default\treePrefs.json

(3)(+0004325): renderTemplateAsync: [Item] v3 collect annotations and notes by tag

(3)(+0011147): {better-bibtex} +50586 on-idle: idle.observe: { topic: 'idle', data: '10' }

(3)(+0047449): {better-bibtex} +47449 on-idle: idle.observe: { topic: 'active', data: '0' }

@windingwind
Copy link
Owner

res += `<h2>${attachment.attachmentFilename()}</h2>` ;

Here is a possible reason: you don't need to call attachmentFilename(), but just use res += `<h2>${attachment.attachmentFilename}</h2>

@sjgknight
Copy link

@windingwind thank you, that has fixed that so I now get content! I appreciate the help 👍
I had thought I'd see the full extracts (pdf image extracts + text), as with the item-notes with metadata template (except filtered to just the tags I selected), as in the screenshot, but I suspect that's me misunderstanding a notes/annotations distinction.

@windingwind
Copy link
Owner

@sjgknight This template only inserts notes as link. If you want to embed the whole note, we could have further discussions in a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants