Facebook Login not working

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Wed Nov 05, 2014 11:20 am
Reply with quote
Report this post
I have installed this template and wanted to use the facebook registration.

On my previous template i was using the JFBConnect without any problem. Now on news2 the same JFBConnect cannot work. When i do a test check it says that.

Code: Select all
Test: Facebook Javascript library inclusion
Fail: Another Facebook extension is installed, including the Facebook Javascript library, and may conflict.


When i ask the developer of the module he says:

Code: Select all
Both your template and a "Find us on Facebook" module are including the older Facebook Javascript library which will prevent JFBConnect, which is using the latest version of the Javascript library, from working. You'll need to disable the older Javascript inclusions to get things working.



I installed this on my site as a starterpack so all settings are from gavic.

I have tried to deactivate the obvious facebook settings on the template and extensions but still the JFBConnect doesn't work.


So how can i disable the old javascript inclusion for me to able to use this extension?


Many thanks
User avatar
Fresh Boarder

teitbite
Thu Nov 06, 2014 9:54 pm
Reply with quote
Report this post
Hi

Please edit file /layout/blocks/social.php and remove this code:

Code: Select all
<?php if($this->API->get('fb_login', '0') == 1 || ($this->API->get('fb_like', '0') == 1 && $option == 'com_content' && $view == 'article')) : ?>
<gavern:social>
<div id="gkfb-root"></div>
<?php if($this->API->get('cookie_consent', '0') == 0) : ?>
<script type="text/javascript">
<?php else : ?>
<script type="text/plain" class="cc-onconsent-social">
<?php endif; ?>

//<![CDATA[
      window.fbAsyncInit = function() {
      FB.init({ appId: '<?php echo $this->API->get('fb_api_id', ''); ?>',
         status: true,
         cookie: true,
         xfbml: true,
         oauth: true
      });
            
        <?php if($this->API->get('fb_login', '0') == 1) : ?>
        function updateButton(response) {
          var button = document.getElementById('fb-auth');
      
         if(button) {   
             if (response.authResponse) {
             // user is already logged in and connected
             button.onclick = function() {
                 if(document.id('login-form')){
                     document.id('modlgn-username').set('value','Facebook');
                     document.id('modlgn-passwd').set('value','Facebook');
                     document.id('login-form').submit();
                 } else if(document.id('com-login-form')) {
                    document.id('username').set('value','Facebook');
                    document.id('password').set('value','Facebook');
                    document.id('com-login-form').submit();
                 }
             }
         } else {
             //user is not connected to your app or logged out
             button.onclick = function() {
                 FB.login(function(response) {
                    if (response.authResponse) {
                       if(document.id('login-form')){
                         document.id('modlgn-username').set('value','Facebook');
                         document.id('modlgn-passwd').set('value','Facebook');
                         document.id('login-form').submit();
                       } else if(document.id('com-login-form')) {
                          document.id('username').set('value','Facebook');
                          document.id('password').set('value','Facebook');
                          document.id('com-login-form').submit();
                       }
                   } else {
                     //user cancelled login or did not grant authorization
                   }
                 }, {scope:'email'});   
             }
          }
       }
     }
     // run once with current status and whenever the status changes
     FB.getLoginStatus(updateButton);
     FB.Event.subscribe('auth.statusChange', updateButton);   
     <?php endif; ?>
   };
    //     
   window.addEvent('load', function(){
        (function(){
                if(!document.getElementById('fb-root')) {
                     var root = document.createElement('div');
                     root.id = 'fb-root';
                     document.getElementById('gkfb-root').appendChild(root);
                     var e = document.createElement('script');
                 e.src = document.location.protocol + '//connect.facebook.net/<?php echo $this->API->get('fb_lang', 'en_US'); ?>/all.js';
                     e.async = true;
                 document.getElementById('fb-root').appendChild(e);   
                }
        }());
    });
    //]]>
</script>
</gavern:social>
<?php endif; ?>
User avatar
Moderator

teitbite
Thu Nov 20, 2014 6:09 pm
Reply with quote
Report this post
Hi

I just recived an information that all packages has been updated with a fixed facebook authentication plugin and a fixes to social.php file. There should be no problem now.
User avatar
Moderator


cron