WordPress.org

Ready to get started?Download WordPress

Forums

qTranslate Separate Comments
[resolved] Comments Redirect doesn't work (17 posts)

  1. coris
    Member
    Posted 1 year ago #

    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/

  2. Nikola Nikolov
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  3. coris
    Member
    Posted 1 year ago #

    I've already figured out several weeks ago. Everything works fine now. Thanks anyway for your plugin :)

  4. Nikola Nikolov
    Member
    Plugin Author

    Posted 1 year ago #

    Was that the problem or was it something else?

  5. coris
    Member
    Posted 1 year ago #

    Yeah, was that ;)

  6. a.s.panchenko
    Member
    Posted 1 year ago #

    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.

  7. Nikola Nikolov
    Member
    Plugin Author

    Posted 1 year ago #

    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 :)

  8. a.s.panchenko
    Member
    Posted 1 year ago #

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

  9. Nikola Nikolov
    Member
    Plugin Author

    Posted 1 year ago #

    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 :)

  10. a.s.panchenko
    Member
    Posted 1 year ago #

    Yes, this hack works fine now ))

    Thanks for help.

  11. Nikola Nikolov
    Member
    Plugin Author

    Posted 1 year ago #

    Glad it works :)

    I'll put this into an update really soon.

  12. mikewinsc
    Member
    Posted 1 year ago #

    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

  13. Nikola Nikolov
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  14. mikewinsc
    Member
    Posted 1 year ago #

    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

  15. Nikola Nikolov
    Member
    Plugin Author

    Posted 1 year ago #

    Can you mail me at [my username]@gmail.com ?

  16. Webprom Design
    Member
    Posted 1 year ago #

    return preg_replace( '~' . preg_quote( home_url( '' ), '~' ) . '~', '', qtrans_convertURL() ); - this fix worked, please remember to include in next version :) thanks, great plugin!

  17. Nikola Nikolov
    Member
    Plugin Author

    Posted 1 year ago #

    I just finally released the new version with this fix included. I also tested in a root-level install as well as in a sub-director install. If yo have a case where it still doesn't work properly - feel free to write on the forum :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.