Support » Plugin: qTranslate Separate Comments » Comments Redirect doesn't work

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Nikola Nikolov

    (@nikolovtmw)

    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 🙂

    Plugin Author Nikola Nikolov

    (@nikolovtmw)

    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.

    Plugin Author Nikola Nikolov

    (@nikolovtmw)

    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">).

    Plugin Author Nikola Nikolov

    (@nikolovtmw)

    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.

    Plugin Author Nikola Nikolov

    (@nikolovtmw)

    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

    Plugin Author Nikola Nikolov

    (@nikolovtmw)

    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 the comment_form action hook, which is called from the comment_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

    Plugin Author Nikola Nikolov

    (@nikolovtmw)

    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!

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Comments Redirect doesn't work’ is closed to new replies.