From 323f03bd2d9179fbb923e4518853324d8bda1b95 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 19 Dec 2018 16:11:23 +0000 Subject: [PATCH] Added a comment about vertical tab problem. --- WEB-INF/lib/ttOrgImportHelper.class.php | 22 +++++++++++++++++++--- WEB-INF/templates/footer.tpl | 2 +- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/WEB-INF/lib/ttOrgImportHelper.class.php b/WEB-INF/lib/ttOrgImportHelper.class.php index e95b836d..099cb58f 100644 --- a/WEB-INF/lib/ttOrgImportHelper.class.php +++ b/WEB-INF/lib/ttOrgImportHelper.class.php @@ -493,9 +493,25 @@ class ttOrgImportHelper { } } - // importXml - uncompresses the file, reads and parses its content. During parsing, - // startElement, endElement, and dataElement functions are called as many times as necessary. - // Actual import occurs in the endElement handler. + // importXml - uncompresses the file, reads and parses its content. + // It goes through the file 2 times. + // + // During 1st pass, it determines whether we can import data. + // In 1st pass, startElement function is called as many times as necessary. + // + // Actual import occurs during 2nd pass. + // In 2nd pass, startElement and endElement are called many times. + // We only use endElement to finish current group processing. + // + // The above allows us to export/import complex orgs with nested groups, + // while by design all data are in attributes of the elements (no CDATA). + // + // There is currently at least one problem with keeping all data in attributes: + // a vertical tab character 0xB anywhere breaks parsing, making import impossible. + // See https://github.com/sparklemotion/nokogiri/issues/1581 - looks like + // an XML standard thing. Apparently, other invalid characters break parsing too. + // This problem needs to be addressed at some point but how exactly without + // complicating export-import too much with CDATA and dataElement processing? function importXml() { global $i18n; diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index c8933865..ee01f47f 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.32.4664 | Copyright © Anuko | +  Anuko Time Tracker 1.18.32.4665 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} -- 2.20.1