Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If selected page's name contains non-english character then it won't open tree accordingly #50

Closed
sander85 opened this issue Oct 21, 2013 · 5 comments
Labels

Comments

@sander85
Copy link

Url to test with: http://wiki.example.com/tehnikaveeb:kaugtöö.

http://wiki.example.com/tehnikaveeb:kaugtoo would work OK but I'd like to make it work with non-english words too.

@sander85
Copy link
Author

Not 100% sure but this change in syntax/indexmenu.php seems to fix it:

@@ -404,7 +404,7 @@
                 //insert node in last position
                 array_push($q, $i);
             }
-            $out .= $jscmd."('".idfilter($item['id'])."',$i,".$father.",'".$item['title']."'";
+            $out .= $jscmd."('".rawurldecode(idfilter($item['id']))."',$i,".$father.",'".$item['title']."'";
             //hns
             ($item['hns']) ? $out .= ",'".idfilter($item['hns'])."'" : $out .= ",0";
             ($item['type'] == 'd' || $item['type'] == 'l') ? $out .= ",1" : $out .= ",0";

@Klap-in
Copy link
Collaborator

Klap-in commented Oct 22, 2013

Similar example from #52:

When page name selected contain non-english character it can't remember current tree state, but in the same sub-tree when only english character is used in page name it remember correctly! Any idea?

And here are my examples :

diary
diary:2013.10:2013.10.21_-_monday   (OK ✔)
diary:2013.10:2013.10.21_-_星期一   (Wrong ✘)
diary:2013.10:2013.10.21_-_월요일   (Wrong ✘)

Was reported at:
https://www.dokuwiki.org/plugin:indexmenu#js_does_not_remember_its_previous_state

@samuelet
Copy link
Owner

I don't understand why it needs to be urlencoded when the idfilter func already takes care of doing this:
http://xref.dokuwiki.org/reference/dokuwiki/inc/common.php.source.html#l341

Any idea?
What's your version of dokuwiki and what's your webserver, iis or apache? Are you using dokuwiki url rewriting?

@sander85
Copy link
Author

Ok, now looking at what idfilter() does my proposal was a bit stupid indeed. But I didn't want to encode it but decode.. JS probably doesn't match it when it's encoded and that's why it's not opening the tree.

So my new proposal would be this:

$out .= $jscmd."('".idfilter($item['id'])."',$i,".$father.",'".$item['title']."'";
=>
$out .= $jscmd."('".idfilter($item['id'], false)."',$i,".$father.",'".$item['title']."'";

Turning off encoding here fixes the problem for me.

I'm running the latest version of dokuwiki on Apache.

@samuelet
Copy link
Owner

Sorry confusing the func, quick read = wrong read.
Does the patch work also with the nojs and #max (ajax stuff) options?

samuelet added a commit that referenced this issue Jul 31, 2014
prevent non-english chars are encoded. Fixes #50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants