Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Facebook Share React Pop-up Doesn't close after posting

okhawajaokhawaja New
edited June 2016 in Vanilla 2.0 - 2.8

I have two questions:
1. How can I add twitter to the react beside the Facebook react that I have?

  1. My Share button in discussion is working, but the Facebook React button is doing something weird.....When I click it and the pop-up comes to post on Facebook, I click Post To Facebook in that pop-up, it should post and close that pop-up, but it's redirecting me to a New Discussion creation template instead....Any thoughts as to why?

Comments

  • Btw, I don't know why but even though I have the second point as #2, it appears as #1 on this discussion.

  • hgtonighthgtonight ∞ · New Moderator

    @okhawaja said:
    Btw, I don't know why but even though I have the second point as #2, it appears as #1 on this discussion.

    This is part of the markdown spec: https://daringfireball.net/projects/markdown/syntax#list

    If you want to start a line with a number and a period, you must escape the period, e.g. 2\..

    If you want multiple paragraph lists, you must indent the list items and each paragraph:

    1.  This is a list item with two paragraphs. Lorem ipsum dolor
        sit amet, consectetuer adipiscing elit. Aliquam hendrerit
        mi posuere lectus.
    
        Vestibulum enim wisi, viverra nec, fringilla in, laoreet
        vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
        sit amet velit.
    
    2.  Suspendisse id sem consectetuer libero luctus adipiscing.
    

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited June 2016

    Not sure if this is relevant, but why are you not using pretty URL ?

    This tutorial shows what to do to rewrite the url in the address field in a readable form. You need to modify your htaccess file and also add the $Configuration into the config.php

    https://vanillaforums.org/discussion/25111/about-error-404-not-found

  • okhawajaokhawaja New
    edited June 2016

    @vrijvlinder said:
    Not sure if this is relevant, but why are you not using pretty URL ?

    This tutorial shows what to do to rewrite the url in the address field in a readable form. You need to modify your htaccess file and also add the $Configuration into the config.php

    https://vanillaforums.org/discussion/25111/about-error-404-not-found

    I don't know if I have it set-up properly, but I read that post in my first week and have it setup like this, is it wrong?

    In my config I have pretty url = true.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited June 2016

    Ok, that looks right except that if you modify the htaccess file it is good if you add #Modified instead of #Original because I know that a default htaccess file that comes with vanilla set up has the rule disabled with a # in front of RewriteBase/

    If your forum is in the root of your site as in www.mysite.com/ then only the slash is needed

    But if your forum is in a subdirectory as in www.mysite.com/forum then you need to add the name of the subdirectory whether it is forum or any other name.

  • R_JR_J Ex-Fanboy Munich Admin

    The window that opens although it should not, contains "/post/shared/facebook" in it, which translates to "look in the PostController for a method called 'shared' and pass the rest as arguments".

    There is no such method in the PostController. You can "inject" your own methods into controllers. The facebook plugin does so: it has a postController_facebook_create method. What you see in there happens when you click on a link https://vanillaforums.org/post/facebook/comment?id=241553

    Looking at the plugin I see

                    $Get = array(
                        'app_id' => c('Plugins.Facebook.ApplicationID'),
                        'link' => $Row['ShareUrl'],
                        'name' => Gdn_Format::plainText($Row['Name'], 'Text'),
                        'description' => $Message,
                        'redirect_uri' => url('/post/shared/facebook', true)
                    );
    
                    $Url = 'http://www.facebook.com/dialog/feed?'.http_build_query($Get);
                    redirect($Url);
    

    So after you have successfully used the method facebook() that this plugin has injected into the PostController, you should be redirected to /post/shared/facebook, which looks like something got mixed up there.

    Could you please change that redirect_url line to 'redirect_uri' => url('/post/facebook/shared', true) and try it again?

  • I tried what you said and the pop-up still doesn't close, and it now redirects to this:


  • This is pretty weird....I notice that if I click the Share button from Social share plugin then it works fine and the dialog I get has the url "https://www.facebook.com/sharer.php?u=http://whatexists.ca/discussion/35/iced-or-time&display=popup&ref=plugin&src=like"

    If I click the Facebook share icon under the discussion's react then I get the pop-up that redirects and doesn't close and it has the url "https://www.facebook.com/dialog/feed?app_id=498661183673912&link=http://whatexists.ca/discussion/35/iced-or-time&name=iced+or++time,&description=yet?+-+Since+when,+-+he+said,+-+Ah &redirect_uri=http://whatexists.ca/post/facebook/shared"

  • R_JR_J Ex-Fanboy Munich Admin

    Sorry, now that I know that you are not working with the original code, I do not want to invest time in this. I have no chance in finding errors of plugins that I do not know.

Sign In or Register to comment.