From cc8ef0b93dea83792ac2fb5a71c5ed9f4c740c90 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 24 Nov 2006 06:09:17 +0000 Subject: [PATCH] Fixes #377, Problems scraping from Hubmed/PubMed Fixes #381, SIRSI scraper no longer working at William & Mary And new Amazon scraper. And a few COinS errors. And possibly some others. It turns out Firefox has a bug in which DOM nodeValues greater than 4096 characters are split into multiple nodes, and so any scrapers pulled from the repository with 'code' fields greater than 4K were being truncated. We didn't see it during testing of repo code because most are smaller. Calling normalize() on the node combines the nodes, so future releases won't have the problem regardless of when it's fixed in Firefox. For existing installs, I managed to get PubMed, COinS, SIRSI 2003+, and, with quite a lot of effort, Amazon, under 4096 characters, hopefully without breaking anything. I removed all other scrapers from the repository for now. --- chrome/content/zotero/xpcom/schema.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js index e09c9a6ed8..d198ad2f11 100644 --- a/chrome/content/zotero/xpcom/schema.js +++ b/chrome/content/zotero/xpcom/schema.js @@ -526,6 +526,10 @@ Zotero.Schema = new function(){ * update the local scrapers table with the scraper data **/ function _translatorXMLToDB(xmlnode){ + // Don't split >4K chunks into multiple nodes + // https://bugzilla.mozilla.org/show_bug.cgi?id=194231 + xmlnode.normalize(); + var sqlValues = [ {string: xmlnode.getAttribute('id')}, {string: xmlnode.getAttribute('lastUpdated')},