Bug 38890 - Remove hard-coded project URLs
Summary: Remove hard-coded project URLs
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: reviewed:2022 target:7.6.0
Keywords: difficultyInteresting, easyHack, skillScript, topicCleanup
Depends on:
Blocks: Dev-related
  Show dependency treegraph
 
Reported: 2011-07-01 08:04 UTC by Björn Michaelsen
Modified: 2023-03-22 07:45 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Björn Michaelsen 2011-07-01 08:04:19 UTC
Remove hard-coded project URLs

Background: We still have a number of hardcoded URLs around the place, some of which become visible in the UI. We should have these extracted from a config file instead - preferably a textual 'rc' file (sal has code to parse and use these cf. boots). To find many instances of hard-coded URLs use:

bin/g grep '"http://' | grep '\.[ch]xx:'

or grep for libreoffice.org - BEWARE - many instances of openoffice.org are standards related around ODF and other XML file formats - these must -not- be changed (obviously). But ones that point to simple web pages make good targets for clean configurability.

Skills: git grep, simple C++ programming
Comment 1 Florian Reisinger 2012-05-18 09:03:33 UTC Comment hidden (obsolete)
Comment 2 Björn Michaelsen 2013-10-04 18:47:27 UTC
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility.

see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
Comment 3 Petr Basl 2014-03-06 14:52:41 UTC
I would like to take this bug, if possible.
Comment 4 Petr Basl 2014-04-23 14:02:06 UTC
I wanted to ask, how can one read rc files.
Thank you.
Comment 5 Stephan Bergmann 2014-04-23 14:47:35 UTC
(In reply to comment #4)
> I wanted to ask, how can one read rc files.

rtl/bootstrap.hxx
Comment 6 Robinson Tryon (qubit) 2015-12-14 07:00:42 UTC Comment hidden (obsolete)
Comment 7 Robinson Tryon (qubit) 2016-02-18 14:52:27 UTC Comment hidden (obsolete)
Comment 8 jani 2016-04-18 07:47:57 UTC
still working on this issue?
Comment 9 jani 2016-06-06 06:04:07 UTC
Unassign due to lack of work.

Please remark, if you start working on the issue again, feel free to assign it to yourself.
Comment 10 jani 2016-06-08 06:19:23 UTC
Resetting status.
Comment 11 Asela 2016-08-02 18:11:01 UTC
Hey
I would like to contribute to fix this bug. Is it still open ?
Is there any specific code pointers that should start
Comment 12 jani 2016-08-02 18:17:39 UTC
(In reply to Asela from comment #11)
> Hey
> I would like to contribute to fix this bug. Is it still open ?
> Is there any specific code pointers that should start

Welcome, follow comment #1

And also have a look at 
https://wiki.documentfoundation.org/Development/GetInvolved

have fun
Comment 13 adityapratapsingh51 2021-03-26 08:55:57 UTC
(In reply to Björn Michaelsen from comment #0)
> Remove hard-coded project URLs
> 
> Background: We still have a number of hardcoded URLs around the place, some
> of which become visible in the UI. We should have these extracted from a
> config file instead - preferably a textual 'rc' file (sal has code to parse
> and use these cf. boots). To find many instances of hard-coded URLs use:
> 
> bin/g grep '"http://' | grep '\.[ch]xx:'
> 
> or grep for libreoffice.org - BEWARE - many instances of openoffice.org are
> standards related around ODF and other XML file formats - these must -not-
> be changed (obviously). But ones that point to simple web pages make good
> targets for clean configurability.
> 
> Skills: git grep, simple C++ programming

Could you explain what "...and use these cf. boots..." means?
Comment 14 Buovjaga 2021-03-26 09:17:42 UTC
(In reply to adityapratapsingh51 from comment #13)
> Could you explain what "...and use these cf. boots..." means?

cf. means comparison. Note comment 5
Comment 15 rino19ny 2021-05-29 04:09:56 UTC
wow more than 4 years!

someone still working on this?

by "..around the place.." meaning most source files still have hardcoded URLs??
Comment 16 Buovjaga 2021-05-29 05:48:36 UTC
(In reply to rino19ny from comment #15)
> wow more than 4 years!
> 
> someone still working on this?
> 
> by "..around the place.." meaning most source files still have hardcoded
> URLs??

Please don't change the status to needinfo: https://wiki.documentfoundation.org/QA/Bugzilla/Fields/Status/NEEDINFO
Needinfo reports will be automatically closed after some time, so you don't want to do that here.
Comment 17 Padia Rashesh 2021-06-16 16:29:42 UTC
Basically I have to create a .rc file which contains all the URLs and somehow read it with help of bootstrap.hxx at runtime 
But I am confused on the following points:

1) grep for libreoffice.org - BEWARE - many instances of openoffice.org are standards related around ODF and other XML file formats - these must -not- be changed (obviously). But ones that point to simple web pages make good targets for clean configurability. 

I don't understand what you are trying to say, can you explain with example?
Comment 18 Buovjaga 2021-06-16 18:23:53 UTC
(In reply to Padia Rashesh from comment #17)
> Basically I have to create a .rc file which contains all the URLs and
> somehow read it with help of bootstrap.hxx at runtime 
> But I am confused on the following points:
> 
> 1) grep for libreoffice.org - BEWARE - many instances of openoffice.org are
> standards related around ODF and other XML file formats - these must -not-
> be changed (obviously). But ones that point to simple web pages make good
> targets for clean configurability. 
> 
> I don't understand what you are trying to say, can you explain with example?

Example of such a search hit, pointing to an XML namespace:
UnoControls/util/ctl.component:    xmlns="http://openoffice.org/2010/uno-components">
Comment 19 Stephan Bergmann 2021-06-17 07:54:04 UTC
(In reply to Björn Michaelsen from comment #0)
> Background: We still have a number of hardcoded URLs around the place, some
> of which become visible in the UI. We should have these extracted from a
> config file instead - preferably a textual 'rc' file (sal has code to parse
> and use these cf. boots).

Note that many such URLs are now stored in the configuration, see properties "SendFeedbackURL" etc. in officecfg/registry/data/org/openoffice/Office/Common.xcu.  That's probably the preferred way now.
Comment 20 Xisco Faulí 2022-05-02 14:48:46 UTC
Dear  Padia Rashesh,
This bug has been in ASSIGNED status for more than 3 months without any
activity. Resetting it to NEW.
Please assign it back to yourself if you're still working on this.
Comment 21 Hossein 2022-08-06 13:38:29 UTC
Re-evaluating the EasyHack in 2022

This enhancement is still relevant. Some hard-coded project URLs are still in the code.
Comment 22 Samuel Adesola 2023-03-17 20:41:34 UTC
(In reply to Stephan Bergmann from comment #19)
> (In reply to Björn Michaelsen from comment #0)
> > Background: We still have a number of hardcoded URLs around the place, some
> > of which become visible in the UI. We should have these extracted from a
> > config file instead - preferably a textual 'rc' file (sal has code to parse
> > and use these cf. boots).
> 
> Note that many such URLs are now stored in the configuration, see properties
> "SendFeedbackURL" etc. in
> officecfg/registry/data/org/openoffice/Office/Common.xcu.  That's probably
> the preferred way now.

I am currently working on this bug and have made some progress. I have moved the URLs to the Common.xcu files and modify neccessary CPPUnitTest files, running make was successful bug I am getting an error from make check. 
Something of this nature:
[_RUN_____] testImageHyperlink::TestBody
image-hyperlink.docx:
/home/samuel/Documents/Dev/libreoffice/sw/qa/extras/ooxmlimport/ooxmlimport.cxx:82:testImageHyperlink::TestBody
equality assertion failed
- Expected: https://libreoffice.org/
- Actual  : http://www.libreoffice.org/
Comment 23 Samuel Adesola 2023-03-17 20:48:44 UTC
The fail I Saw came in from ww8export3.cxx because it has a block of code in there:

DECLARE_WW8EXPORT_TEST(testHyperLinkURLSaving, "tdf120003.doc")
{
    OUString URL = getProperty<OUString>(getShape(1), "HyperLinkURL");
    // Without the fix in place, this test would have failed with
    // - Expected: https://www.libreoffice.org/
    // - Actual  : tps://www.libreoffice.org/
    CPPUNIT_ASSERT_EQUAL(OUString("https://www.libreoffice.org/"), URL);
}
Comment 24 Buovjaga 2023-03-18 06:55:08 UTC
(In reply to Adoche Onaji from comment #23)
> The fail I Saw came in from ww8export3.cxx because it has a block of code in
> there:
> 
> DECLARE_WW8EXPORT_TEST(testHyperLinkURLSaving, "tdf120003.doc")
> {
>     OUString URL = getProperty<OUString>(getShape(1), "HyperLinkURL");
>     // Without the fix in place, this test would have failed with
>     // - Expected: https://www.libreoffice.org/
>     // - Actual  : tps://www.libreoffice.org/
>     CPPUNIT_ASSERT_EQUAL(OUString("https://www.libreoffice.org/"), URL);
> }

This is about https://gerrit.libreoffice.org/c/core/+/142005

Undo your changes in the test (qa) directories. The use of www.libreoffice.org URLs there is just a coincidence and not relevant for this hack.

So undo like

git checkout master -- sw/qa/extras/odfexport/odfexport2.cxx

for each file and update your patch.
Comment 25 Commit Notification 2023-03-22 07:11:12 UTC
Adoche Onaji committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/b1dc8d302f5a7c7b8f69261f86ff01377a910c68

tdf#38890 Remove hard-coded URLs in source Files

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 26 Stephan Bergmann 2023-03-22 07:45:11 UTC
Per the comment at <https://gerrit.libreoffice.org/c/core/+/149115/3#message-6567492764d8ee5a399865e62ff490863b2625e1> "tdf#38890 Remove hard-coded URLs in source Files":  "So about this bug 149115: tdf#38890 Remove hard-coded URLs in source Files | https://gerrit.libreoffice.org/c/core/+/149115, are there no more hardcoded urls in the source, after grep libreoffice, most outputs are instances of open office or comments or Test codes"

And I also hardly find anything that looks like it could be another target for this easyHack when I search now, so lets leave it at that.