• Copy URL to a file won't work by uuid

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #23023  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
Last edited by shie on Tue May 14, 2013 2:59 am, edited 1 time in total.
 #46096  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.
 #46125  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 "&".
Attachments
uuid-link-to-document.png
uuid-link-to-document.png (18.19 KiB) Viewed 3775 times
 #46133  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 ?
 #46264  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.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.