Page 2 of 2

Re: Copy URL to a file won't work by uuid

PostPosted:Mon May 13, 2013 2:36 am
by shie
hello!
I meet the same problem.
I get the link ( http://172.18.73.38:8080/OpenKM/index.jsp?docPath=%2Fokm%3Aroot%2Ftest%2Ftest.docx )from menu File_SendDocumentLink, it works OK, I visit the link and it takes me to the file test.docx.
But, I copy the URL ( http://172.18.73.38:8080/OpenKM/index.jsp?uuid=2bf1499d-7e9a-4bf1-b4b1-8c96df48ca28 ) from Properties, it takes me to okm:root instead of the file.
Thank u!

OKM Community Version:6.2.4-DEV b:7988

Re: Copy URL to a file won't work by uuid

PostPosted:Mon May 13, 2013 6:58 am
by Catscratch
jllort wrote:And in that case is not going right or goes right ?
No, in that case the error occurs.

Re: Copy URL to a file won't work by uuid

PostPosted:Mon May 13, 2013 12:10 pm
by rbahntje
I am testing with same user and it doesn´t works

Re: Copy URL to a file won't work by uuid

PostPosted:Wed May 15, 2013 6:00 am
by jllort
confirmed is a bug, I have added a ticket about it http://issues.openkm.com/view.php?id=2823

Re: Copy URL to a file won't work by uuid

PostPosted:Tue Jun 12, 2018 11:45 pm
by peterb
I ended up here while trying to search online for a solution to this issue, which still appears to be broken in version CE 6.3.6.

Here is what I have found, which may provide more clues than earlier mentioned in this thread.

If I copy the link by UUID as earlier attempts I get a link similar to the above users, in my case the link is (apart from the domain being replaced with "domain.com"):
Code: Select all
https://domain.com/OpenKM/index.jsp?uuid=cf605476-6c48-416e-8582-c5ec06e086f5
When I attempt to go to this link I end up in root as stated earlier. But the link actually also gets rewritten as shown below:
Code: Select all
https://domain.com/OpenKM/frontend/index.jsp?uuid=cf605476-6c48-416e-8582-c5ec06e086f5?lang=en-GB
As you can see the link has been rewritten to include "frontend" in the middle and "?lang=en-GB" at the end. If I now simply remove the "?lang=en-GB" at the end of the link, I actually get to the intended document (as expected).

Now looking at the configuration we have the following setting:
Code: Select all
default.lang = en-GB
If I change that setting to be blank, then the link gets rewritten to (same as above after removing "?lang=en-GB"):
Code: Select all
https://domain.com/OpenKM/frontend/index.jsp?uuid=cf605476-6c48-416e-8582-c5ec06e086f5
And this link as well as the original link do now take me to the expected document. It essentially appears as the "?lang=en-GB" causes the issue with the link. Essentially the search for the document seems to incorrectly fail when the language setting gets appended to the search string.

And yes, I did see that master user "jllort" did file a ticket for this in 2013, but I can't follow that link and the issue seems still present. Don't hesitate to let me know if you want me to file this issue somewhere else.

Re: Copy URL to a file won't work by uuid

PostPosted:Fri Jun 15, 2018 7:06 am
by jllort
The link is wrong
https://domain.com/OpenKM/frontend/inde ... lang=en-GB

Should be
https://domain.com/OpenKM/frontend/inde ... lang=en-GB ( last ? replaced by & )

From where was generated ( copied ) the URL ?

Re: Copy URL to a file won't work by uuid

PostPosted:Fri Jun 15, 2018 10:13 am
by peterb
I get the original link via the web interface, by clicking on the link icon next to "URL", which is the second last entry on the property tab. I have created a screen shot and marked in red colour where I am clicking to get the UUID link.

This link typically looks like this (this is the first link from my original message):
Code: Select all
https://domain.com/OpenKM/index.jsp?uuid=cf605476-6c48-416e-8582-c5ec06e086f5
Then I paste that link into my web browser (Firefox ESR 52.8.1) which appears to get rewritten/redirected by OpenKM to the following (incorrect) link:
Code: Select all
https://domain.com/OpenKM/frontend/index.jsp?uuid=cf605476-6c48-416e-8582-c5ec06e086f5?lang=en-GB
So, to answer your question I'd say the link is coming from OpenKM when it rewrites the string/link to include "frontend" and then the language setting at the end of the updated/redirected link. Like you pointed out it appears to put the "?" instead of "&".

Re: Copy URL to a file won't work by uuid

PostPosted:Sat Jun 16, 2018 3:29 pm
by jllort
do you have the property default.lang set ?
what is you application.url value ?
finally, this is happens with the latest OpenKM version ?

Re: Copy URL to a file won't work by uuid

PostPosted:Mon Jul 02, 2018 6:42 pm
by peterb
Apologies for the late reply, but I believe we can fix this issue as described below. I'll first answer your specific questions:
do you have the property default.lang set ?
As I posted on the 12th of June, yes, this is very interesting. If I have this setting as
Code: Select all
default.lang = en-GB
then I get the issue and the link gets rewritten to include the language parameter at the end. However, if I leave this setting blank, then the link doesn't get a language parameter at the end and the link then works. I believe this means the problem only happens if a language is set, and as you pointed out it simply uses the wrong character to separate the parameters (? instead of &).
what is you application.url value ?
I have this set to
Code: Select all
application.url = https://domain.com/OpenKM/index.jsp
(except the actual domain replaced with "domain.com".
finally, this is happens with the latest OpenKM version?
I am using version CE 6.3.6, which I also mentioned in my post on the 12th of June.

I believe the code below might be related to the issue. In the file "index.jsp" lines 28-34 it seems to add the language parameter to the link if the language parameter is not empty. Then on line 29 it determines whether to add it with the ? or & characters. I believe that if statement needs to be changed to fix this bug. Here is the code section I am referring to below.
Code: Select all
	if (!Config.DEFAULT_LANG.equals("")) {
		if (docPath != null || fldPath != null) {
			url += "&lang=" + Config.DEFAULT_LANG;
		} else {
			url += "?lang=" + Config.DEFAULT_LANG;
		}
	}
And here is what I believe the if statement should be changed to:
Code: Select all
		if (docPath != null || fldPath != null || uuid != null)
Essentially a first parameter gets set already on lines 20-21 if a UUID is passed in, meaning on lines 28-34 the language parameter is no longer the first parameter, which the corrected if statement just above should hopefully correct.

Re: Copy URL to a file won't work by uuid

PostPosted:Tue Jul 03, 2018 8:05 am
by jllort
Please add the ticket here https://github.com/openkm/document-mana ... tem/issues ( it seems a bug ). In the ticket add the URL of this forum post.