Keyword

K2 kills facebook when using JomSocial (Solved)

  • frold
  • frold's Avatar Topic Author
  • Offline
  • Junior Member
More
12 years 8 months ago - 12 years 8 months ago #102399 by frold
Hey,

I was hoping to use K2 with JomSocial and the template JA Social from JoomlaArt.

When testing at my localhost and when installing on my live site www.studmed.dk - the login using facebook function doesnt work.

This is the popup I normaly get:

File Attachment:


It just shows up in less then a nano second and then it is away just after I have installed K2. With nothing content, no user merge, just a plain vanilla installion.

Is that a known issue? How to solve it?

UPDATE:
This is how it look like when K2 is installed:

www.screenr.com/grf8


This is how it look like whit out K2, and this is how it should work!

www.screenr.com/Crf8

Please Log in or Create an account to join the conversation.

  • frold
  • frold's Avatar Topic Author
  • Offline
  • Junior Member
More
12 years 8 months ago #102400 by frold
When I compare the html output for the 2 solution: without K2 and with K2 I only see one major different.

When K2 is installed there is added this JS to the html output:

<script type="text/javascript">

window.addEvent('domready', function() {

SqueezeBox.initialize({});
SqueezeBox.assign($$('a.modal'), {
parse: 'rel'
});
});
var K2SitePath = '/';


I dont understand that JS but could it be the reason?

Please Log in or Create an account to join the conversation.

  • frold
  • frold's Avatar Topic Author
  • Offline
  • Junior Member
More
12 years 8 months ago #102401 by frold

frold wrote: <script type="text/javascript">

window.addEvent('domready', function() {

SqueezeBox.initialize({});
SqueezeBox.assign($$('a.modal'), {
parse: 'rel'
});
});
var K2SitePath = '/';


I dont think it that snippet that course the issue. I think that code comes from libraries/joomla/html/html/behavior.php - did remove that part and FB login still doesnt work...

I really hope someone can help, else Im not able to use K2 on my site... ;(

Please Log in or Create an account to join the conversation.

More
12 years 8 months ago #102402 by Lefteris
Hi. Probably there is a javascript conflict causing all this. Are you getting any javascript errors? In the video it seems like the popup opens but closes immediately. Does this happen every time?

Please Log in or Create an account to join the conversation.

  • frold
  • frold's Avatar Topic Author
  • Offline
  • Junior Member
More
12 years 8 months ago #102403 by frold

Lefteris Kavadas wrote: Hi. Probably there is a javascript conflict causing all this. Are you getting any javascript errors? In the video it seems like the popup opens but closes immediately. Does this happen every time?


I dont get any errors in Firefox 15, not what I can see. Maybe i have to enable something?...

The funny thing If Im not logged in to facebook I get promted to do so, when I am the popup disapear quickly...

See here: www.screenr.com/DYf8

Please Log in or Create an account to join the conversation.

More
12 years 8 months ago #102404 by Lefteris
Is your current page a K2 item? If so go to the item's settings and set "Facebook button" to "Hide". Are you sure that you get this behavior only with K2? I mean that it maybe another type of issue.

Please Log in or Create an account to join the conversation.

  • frold
  • frold's Avatar Topic Author
  • Offline
  • Junior Member
More
12 years 8 months ago #102405 by frold
Hey,

The page is not a K2 item (Its JomSocial frontend), but the "problem" is first initiated when K2 is installed. Just after I installed K2.

So in some way it must be related to K2, but if it is a JomSocial or a template issue related to my joomlart template, I can´t say cause i dont have the skills.

Facebook login works great without K2 installed - I have used it for a year at my live site: www.studmed.dk

Please Log in or Create an account to join the conversation.

More
12 years 8 months ago #102406 by Lefteris
The fact that it works no an other site that doesn't have K2 doesn't mean anything. I can post you several sites with K2 and JomSocial with Facebook login working normally. And since this page is not generated by K2 then maybe it's something else. Can you post a link to your site? Otherwise i am afraid i cannot help you further.

Please Log in or Create an account to join the conversation.

More
12 years 8 months ago #102407 by Lefteris
I mean the development site, which has also K2 installed.

Please Log in or Create an account to join the conversation.

  • frold
  • frold's Avatar Topic Author
  • Offline
  • Junior Member
More
12 years 8 months ago #102408 by frold

Lefteris Kavadas wrote: The fact that it works no an other site that doesn't have K2 doesn't mean anything. I can post you several sites with K2 and JomSocial with Facebook login working normally. And since this page is not generated by K2 then maybe it's something else. Can you post a link to your site? Otherwise i am afraid i cannot help you further.


I did now installed K2 at my live board: www.studmed.dk

Please let me know when you have tested it, cause then I will uninstall K2. Cause, as you understand, et blocks the login of facebook users...

I really appreciate your help!

Please Log in or Create an account to join the conversation.

  • frold
  • frold's Avatar Topic Author
  • Offline
  • Junior Member
More
12 years 8 months ago - 12 years 8 months ago #102409 by frold
Hmm maybe its more a template issue?

I can see my menu is not working either when K2 is installed.

All the items: Forum, Afstemninger etc should open up when mouse over...

Like here:

File Attachment:


Edit: the menu works when you are on pages like: studmed.dk/kontakt-os and studmed.dk/afstemninger but not the front page....

Please Log in or Create an account to join the conversation.

  • frold
  • frold's Avatar Topic Author
  • Offline
  • Junior Member
More
12 years 8 months ago #102410 by frold
Please let me know when you have tested it cause at the moment my users using facebook as a login aint able to login...

Please Log in or Create an account to join the conversation.

  • frold
  • frold's Avatar Topic Author
  • Offline
  • Junior Member
More
12 years 8 months ago #102411 by frold
Okay,

Now I did spot it down to k2.js

When I remove the content in that file every thing works great.

Im not able to spot what specific in the file that course the problem, but when I delete the content in that file and uploads a empty k2.js and empty my cache every things works again: my menu, facebook login...

Any ideas what could be wrong in it?

This is the content of my k2.js

pastebin.com/ub3FRU4G

Please Log in or Create an account to join the conversation.

  • frold
  • frold's Avatar Topic Author
  • Offline
  • Junior Member
More
12 years 8 months ago #102412 by frold
Finally!!

I think I did solve it.

It seems like there is a problem when using a joomlart template.

When doing so and T3 optimize the js files.

And there is something that is messed up when T3 try to optimize k2.js

When I did add (the original) k2.js into the fields Optimize Exclude in my template control center every things work. Now the js filed is called like:


<script src="/components/com_k2/js/k2.js" type="text/javascript"></script>

instead of in a compiled file like:

<script src="/index.php?jat3action=gzip&amp;jat3type=js&amp;jat3file=t3-assets%2Fjs_58988e.js" type="text/javascript"></script>

File Attachment:

Please Log in or Create an account to join the conversation.

More
12 years 8 months ago #102413 by Lefteris
I am glad you solved it. Thanks for sharing this with the community.

Please Log in or Create an account to join the conversation.

  • Vincent Nonnenmacher
  • Vincent Nonnenmacher's Avatar
  • Offline
  • New Member
More
12 years 8 months ago #102414 by Vincent Nonnenmacher
Replied by Vincent Nonnenmacher on topic Re: K2 kills facebook login when using JomSocial
I don't think this compression and packing is the problem.

I got the same one and from a non T3 template (no framework).

I think it is because I removed all mootool scripts (including modal.js) and got the same
error.

Sound like there is still a dependency from K2 to moo tools, on this SqueezeBox that is all around the K2.js code.

The included hook (in my case components/com_ninja/html/behavior.php), give the same error as reported :

joomla25:38TypeError: 'undefined' is not a function (evaluating 'window.addEvent('domready', function() {

SqueezeBox.initialize({});
SqueezeBox.assign($$('a.modal'), {
parse: 'rel'
});
})')

seems to come from an included plug-ins (ninja_board) that relies on the koowa framework in this file

components/com_ninja/html/behavior.php around lines 201 :

// Attach modal behavior to document
$document->addScriptDeclaration("
window.addEvent('domready', function() {

SqueezeBox.initialize(".$options.");

$$('".$selector."').each(function(el) {
el.addEvent('click', function(e) {
new Event(e).stop();
SqueezeBox.fromElement(el);
});
});
});");

Is there is a document way to remove front-end dependency on mootools ?

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum