Bug 106684 - HELPAUTHORING: Default file path incorrect for new files
Summary: HELPAUTHORING: Default file path incorrect for new files
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
5.4.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-21 18:57 UTC by Gabor Kelemen (allotropia)
Modified: 2022-01-12 16:37 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
New file created with the extension (1.48 KB, application/xml)
2017-03-21 18:57 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2017-03-21 18:57:00 UTC
Created attachment 132051 [details]
New file created with the extension

I got the Help Authoring Extension 3.1.4 from 
http://dev-www.libreoffice.org/helpauthoring/
and tried to create a new help file (attached).

I chose to store it in source/text/swriter/01/test.xhp inside my local copy of helpcontent2 repository.

Then there is a line in it:
    <filename>/swriter/01/test.xhp</filename>

This <filename> tag apparently should have the value "text/swriter/01/test.xhp" otherwise the file won't show up in the help viewer, as I learned this the hard way yesterday evening ;).
Comment 1 Gabor Kelemen (allotropia) 2017-03-21 18:58:52 UTC
Oh no, it should be "/text/swriter/01/test.xhp" - sorry.
Comment 2 Olivier Hallot 2017-04-06 15:14:52 UTC
Set as invalid, after comment#1.
If not, please revert.
Comment 3 Gabor Kelemen (allotropia) 2017-04-06 18:58:55 UTC
I was a bit terse I guess: the extension currently generates 
<filename>/swriter/01/test.xhp</filename> 
but it should generate:
<filename>/text/swriter/01/test.xhp</filename>

I missed the opening slash at first, this is what I meant in comment #1
Comment 4 Xisco Faulí 2017-06-26 18:22:41 UTC
This bug was never confirmed. Moving back to UNCONFIRMED
Comment 5 beimaginativeegroup 2017-08-09 12:42:54 UTC
Gabor Kelemen, what is your document root? Was it, as requested by the dialog box, the source/ file?

I have managed to reproduce this and found a workaround by setting the repository folder as the document root. So, for example, in the help folder. On my end, I can confirm this on Windows.
Comment 6 Gabor Kelemen (allotropia) 2017-08-09 16:22:11 UTC
(In reply to beimaginativeegroup from comment #5)
> Gabor Kelemen, what is your document root? Was it, as requested by the
> dialog box, the source/ file?
> 

I think so. Now I see: 
gabor@dome:~/.config/libreoffice/4/user$ head config/helpauthoring.cfg
HelpPrefix=file:///home/gabor/src/core/helpcontent2/source/

so the helpcontent2/source/ directory is set. The built in help of the extension says:

When working on core help files, i.e. the ones inside the helpcontent2 module, the document root must be set to the helpcontent2/source directory. For example, /cws/so-cwsserv01/hcshared99/DEV300/ooo.m99/helpcontent2/source.

Then a freshly generated source file has this: 

hd_id201708091807258191<LINK href="text/shared/01/test4.xhp">Foobar test</LINK>

Which is wrong. 

Also if I remove the helpauthoring.cfg file, I get a warning window saying:

"The Document Root is not set.

You will be asked to set it in the following dialog.  It is the directory 'source/' in the LibreOffice 'help' git repository.

You need to set it only once, then it is remembered in the configuration. You can change it later using Help Authoring -> Set Document Root..."

So I understand I should browse to the helpcontent2/source directory. 

However, if I set the document root to the helpcontent2 directory, like this:
gabor@dome:~/.config/libreoffice/4/user$ head config/helpauthoring.cfg 
HelpPrefix=file:///home/gabor/src/core/helpcontent2/

Then the generated file will have
hd_id201708091818067461<LINK href="source/text/shared/01/test5.xhp">foorbar2</LINK>

This should work!
So I think the error is that the warning dialog and help text gives bad advice.
Comment 7 beimaginativeegroup 2017-08-09 16:31:28 UTC
Basically, that is the problem. As I see it, there are two ways how to fix this, either change the dialog box text or change the filename being written to the file. I'm currently working on the second idea but if someone thinks the first one should be done, feel free to say that.
Comment 8 beimaginativeegroup 2017-08-09 16:49:19 UTC
I've submitted a request with my idea of implementation for the fix of this bug. It's still a work in progress but if someone wants to comment on it, feel free to do. https://gerrit.libreoffice.org/#/c/40933/
Comment 9 beimaginativeegroup 2017-08-09 17:45:11 UTC
I've completed the patch. As far as I know, now the extension should not make a difference where the document root is set.
Comment 10 Olivier Hallot 2022-01-12 16:37:16 UTC
We recommend the XHP editor available in

https://newdesign.libreoffice.org/xhpeditor/index.php.

The HelpAuthoring.oxt extension is deprecated.

Closing -> wontfix