Comments Redirect doesn't work
-
I’ve installed the plugin into my website, and it still redirect to default language. What can I do to fix it?
http://www.lt-light.com/website
http://wordpress.org/extend/plugins/qtranslate-separate-comments/
-
Sorry for answering after so much time – I don’t get emails when new support topics are opened and I haven’t looked here for a long time π
Any way, I registered for your site and I’m waiting for the email right now, so that I can take a look at your comments form.
I guess though that the hidden inputs that I add in order to get the proper language and redirection are not added to your comments form.
I’ve already figured out several weeks ago. Everything works fine now. Thanks anyway for your plugin π
Was that the problem or was it something else?
Yeah, was that π
Hi
There is a bug with redirection. If we have a/land/
type of url-modification, redirection always works to main language page.Exp.
mysite.com/fr/contact
will redirect to
mysite.com/contact
I’ve looked for and find that there is a hidden input, but it has wrong value like this
/contact
(should/fr/contact
).Anyway, thanks for your plugin. If you have solution let me know.
Hi, can you try to change this code in
qtranslate-separate-comments.php
:return $pageURL;
with:
return qtrans_convertURL();
And tell me if it works,
thanks πNo, it doesn’t ))
Redirection still goes to main lang.
Comment leaved on additional language page marked as a main lang (it was before this fix too).But now hidden input looks like:
<input type="hidden" value="http://mysite.com/fr/contact/" name="qtc_comment_from">
Before this fix it looked like:
<input type="hidden" value="/contact" name="qtc_comment_from">
If manualy change (with firebug for exp.) it to
/fr/contact
everything works fine (<input type="hidden" value="/fr/contact" name="qtc_comment_from">
).What if you do this:
return preg_replace( '~' . preg_quote( home_url( '' ), '~' ) . '~', '', qtrans_convertURL() );
I’m sorry for making you test things out like that, but I have too much work right now to test this myself π
Yes, this hack works fine now ))
Thanks for help.
Glad it works π
I’ll put this into an update really soon.
Nikolov,
I tried your hack above but it didn’t work on my dev site. Is there anything I am doing wrong here?
My dev site: http://www.196flavors.com/dev
The comment gets posted in default language and user is redirected to post in English (default language)
Thanks for your help. This would be a great plugin if it worked on our site.
Michael
Hi, it seems that you’re missing the
comment_form
action hook in your custom comments form.See this entry from the “FAQ” of the plugin:
The plugin doesn’t redirect to the proper language and the language is set incorrectly
In order to properly identify where the comment is coming from, this plugin adds a hidden input to the Comments form. This is done by hooking a function to thecomment_form
action hook, which is called from thecomment_form()
WordPress function. If you are using a custom comments form instead of calling this function, make sure to add<?php do_action( 'comment_form', $post->ID ); ?>
. If this still doesn’t work, replace that code with the following:<?php global $post; do_action( 'comment_form', $post->ID ); ?>
.================================
Adding the above should solve your issue.
Thanks Nikolov but I am not sure where to place this code.
For info, I was using the standard comments before yesterday and it still didn’t work. I installed Jetpack comments (right before I posted my question) and that is what you tested and why you made a reference to a custom comments form.
Could you help me understand where to place this code:
1. For the standard comment form
2. For Jetpack (if possible)FYI, I just reverted back to the standard comments form by deactivating Jetpack
Can you mail me at [my username]@gmail.com ?
return preg_replace( '~' . preg_quote( home_url( '' ), '~' ) . '~', '', qtrans_convertURL() );
– this fix worked, please remember to include in next version π thanks, great plugin!
- The topic ‘Comments Redirect doesn't work’ is closed to new replies.