Bug 418067 - Internal field names can retain problematic characters
Summary: Internal field names can retain problematic characters
Status: RESOLVED FIXED
Alias: None
Product: tellico
Classification: Applications
Component: general (show other bugs)
Version: 3.2.3
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: Robby Stephenson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-23 02:13 UTC by Robby Stephenson
Modified: 2020-02-29 03:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 3.3


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robby Stephenson 2020-02-23 02:13:43 UTC
Need to remove '.' and ':', among others. Reported here: https://forum.kde.org/viewtopic.php?f=200&t=164593&sid=b145727e2e6cba25855e12745fbe78af

Turns out that the file had internal field names of "lc-no.:" and "internal-sn:". The semi-colons cause problems with the namespace parsing.
Comment 1 Robby Stephenson 2020-02-27 02:25:09 UTC
Git commit f83a00a7ee0c5437f91f104e5ca6982eee06c25c by Robby Stephenson.
Committed on 27/02/2020 at 02:23.
Pushed by rstephenson into branch 'master'.

Update XML name validity check to use appropriate libxml2 function

Since previous versions of Tellico could potentially write invalid
XML elements, a future commit will provide a workaround to load those
invalid files.
FIXED-IN: 3.3

M  +1    -1    src/tests/tellicoreadtest.cpp
M  +1    -1    src/translators/tellico_xml.cpp

https://commits.kde.org/tellico/f83a00a7ee0c5437f91f104e5ca6982eee06c25c
Comment 2 Robby Stephenson 2020-02-27 04:08:40 UTC
Git commit b7cb3de69a4fe150af103f2928c189a46f84f06c by Robby Stephenson.
Committed on 27/02/2020 at 04:07.
Pushed by rstephenson into branch 'master'.

Attempt to recover invalid XML data written with older Tellico versions

If the XML loading fails, scan the field names and determine if any are
invalid. If so, do a find/replace across the whole data file and attempt
to reload.

Add a unit test that should cover most cases.

M  +4    -0    ChangeLog
A  +25   -0    src/tests/data/bug418067.xml
M  +33   -0    src/tests/tellicoreadtest.cpp
M  +3    -0    src/tests/tellicoreadtest.h
M  +59   -0    src/translators/tellico_xml.cpp
M  +1    -0    src/translators/tellico_xml.h
M  +11   -0    src/translators/tellicoimporter.cpp

https://commits.kde.org/tellico/b7cb3de69a4fe150af103f2928c189a46f84f06c
Comment 3 Robby Stephenson 2020-02-27 04:16:37 UTC
(In reply to Robby Stephenson from comment #0)
> Turns out that the file had internal field names of "lc-no.:" and
> "internal-sn:". The semi-colons cause problems with the namespace parsing.

Should have said "colons"
Comment 4 Robby Stephenson 2020-02-29 03:18:54 UTC
Git commit 62b3a899bce203f2b0f15cf7ddecd4ece4f37742 by Robby Stephenson.
Committed on 28/02/2020 at 11:51.
Pushed by rstephenson into branch '3.2'.

Update XML name validity check to use appropriate libxml2 function

Since previous versions of Tellico could potentially write invalid
XML elements, a future commit will provide a workaround to load those
invalid files.
FIXED-IN: 3.3

M  +1    -1    src/tests/tellicoreadtest.cpp
M  +1    -1    src/translators/tellico_xml.cpp

https://commits.kde.org/tellico/62b3a899bce203f2b0f15cf7ddecd4ece4f37742