Issue 96134 - wrong path is saved in dbase database
Summary: wrong path is saved in dbase database
Status: CLOSED FIXED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: recent-trunk
Hardware: All All
: P2 Trivial (vote)
Target Milestone: OOo 3.2
Assignee: Frank Schönheit
QA Contact: issues@dba
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-12 09:45 UTC by marc.neumann
Modified: 2017-05-20 10:28 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description marc.neumann 2008-11-12 09:45:48 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.
Comment 1 Frank Schönheit 2008-11-12 11:38:16 UTC
grabbing, since Ocke is not available at the moment.
Comment 2 Frank Schönheit 2008-11-12 11:50:47 UTC
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.
Comment 3 Frank Schönheit 2008-11-12 12:00:35 UTC
note: to re-enable the change, do a
  svn diff -c 263585 | patch -p0 -R
(the disabling was SVN revision 263585)
Comment 4 Frank Schönheit 2008-11-12 13:01:49 UTC
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.
Comment 5 Frank Schönheit 2008-11-13 14:07:26 UTC
fs->msc: please verify in CWS dba31e
Comment 6 marc.neumann 2008-11-14 09:09:27 UTC
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
Comment 7 drewjensen.inbox 2009-05-04 04:04:46 UTC
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.
Comment 8 Frank Schönheit 2009-05-04 09:00:23 UTC
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).
Comment 9 ocke.janssen 2009-05-07 08:19:06 UTC
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.
Comment 10 ocke.janssen 2009-05-07 08:23:08 UTC
Please take care for this one. Thanks.
Comment 11 Stephan Bergmann 2009-05-07 08:29:10 UTC
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.
Comment 12 Stephan Bergmann 2009-05-08 11:18:58 UTC
@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.
Comment 13 ocke.janssen 2009-05-22 07:24:28 UTC
@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

Comment 14 Stephan Bergmann 2009-05-22 12:48:25 UTC
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.
Comment 15 ocke.janssen 2009-05-28 11:24:12 UTC
Fixed in cws dba32d
Comment 16 ocke.janssen 2009-06-17 12:03:42 UTC
Please verify. Thanks.
Comment 17 marc.neumann 2009-06-25 12:43:03 UTC
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