Apache OpenOffice (AOO) Bugzilla – Issue 96134
wrong path is saved in dbase database
Last modified: 2017-05-20 10:28:57 UTC
1. FILE / NEW / Database 2. select dbase as database source 3. click next 4. click the browse button and select the default path 5. click finish in the wizard and save the database to the same path as you select in point 4. This is important 6. close the database 7. unzip the database file and look into the content.xml at the dbase path. ==>> the path is not correct. If you use this registered database in a normal writer formular as datasource you get an error while connection to this database.
grabbing, since Ocke is not available at the moment.
I disabled the code, done for issue 41897, which stores the file location of file-based databases relatively to the .odb file. We need to re-enable it later, in another CWS, to finally fix issue 41879. Then, we also need to care for this issue here.
note: to re-enable the change, do a svn diff -c 263585 | patch -p0 -R (the disabling was SVN revision 263585)
okay, forget what I said :), I was able to fix the real problem. Issue 41897 is now part of the CWS, again, and this issue here is fix properly.
fs->msc: please verify in CWS dba31e
verified in CWS dba31e find more information about this CWS, like when it is available in the master builds, in EIS, the Environment Information System: http://eis.services.openoffice.org/EIS2/cws.ShowCWS?Path=DEV300%2Fdba31e
tested with OO.o 3.1 RC1, XP Ensured that Tools->Options->Load&Save Store files relatively was TRUE Created a new base file of type DBase. Selected the "My Documents" directory for the dBase file location Saved the new ODB file in "My Documents" Checked the path saved in content.xml and it is "../../My%20Documents" That didn't look quite right - but all seemed to work as expected - until - move the dbase files and Base file to a new location. Created a sub-directory in "My Documents"->"moved_dbase_files" and copied all the dbase files and the odb file to it. Opening the "Database properties" dialog for the copy of base file reports the path to the dBase files as: "C:\Documents and Settings\Drew\My Documents\My Documents" Naturally Base is now unable to connect to these files.
fs->oj: see Andrew's description above: While the URL now obviously is expressed relative to the .odb doc, it's still wrong, and cannot be properly resolved when you move the file(s).
The problem seems to be that to make the path file:///C:/Documents%20and%20Settings/oj93728/My%20Documents/New%20Database14.odb/content.xml and path file:///C:/Documents%20and%20Settings/oj93728/My%20Documents relative results in ../../My%20Documents which seems to be wrong.
Please take care for this one. Thanks.
According to oj, the stoc/source/uriproc code is used to make the second URL relative to the first one, and that code appears to produce non-optimal results if the second URL is a prefix of the first one.
@oj: Upon closer inspection, the stoc/source/uriproc code is right in returning "../../My%20Documents" instead of just "..". Making the latter absolute again would lead to "file:///C:/Documents%20and%20Settings/oj93728/My%20Documents/" instead of the original "file:///C:/Documents%20and%20Settings/oj93728/My%20Documents" (note the final slash). (See the two test cases with base URI "scheme://a/b/c/d/e" and to-relativize URIs "scheme://a/b/c" resp. "scheme://a/b/c/" at tags/DEV300_m47/stoc/test/uriproc/test_uriproc.cxx l. 686--688.) The correct fix would be to add a final slash to "file:///C:/Documents%20and%20Settings/oj93728/My%20Documents" before making it relative.
@sb: When adding the final slash nothing changed. Making file:///C:/Documents%20and%20Settings/oj/My%20Documents/ relative to file:///C:/Documents%20and%20Settings/oj/My%20Documents/New%20Database18.odb/content.xml results in ../../My%20Documents
While the stoc/source/uriproc code works correctly, it is the internal function normalize() in svtools/source/misc/urihelper.cxx that can lose the final slash again. @oj: Since the fix for issue 100683 changes the relevant code in xmloff/source/core/xmlexp.cxx to use INetURLObject instead of URIHelper (cws/os128/xmloff/source/core/xmlexp.cxx -c 270258 and -c 270381), the problem described in this issue will best be fixed by waiting for CWS os128 to be integrated and adding the (still necessary) code that adds a final slash to the to-be-made-relative URI, as discussed before. For the broken normalize() in svtools/source/misc/urihelper.cxx I filed the fresh issue 102137.
Fixed in cws dba32d
Please verify. Thanks.
verified in CWS dba32d. The relative path is now correct find more information about this CWS, like when it is available in the master builds, in EIS, the Environment Information System: http://eis.services.openoffice.org/EIS2/cws.ShowCWS?Path=DEV300%2Fdba32d