Topic-icon facebook page keeps redirecting for the new version 5.1

Active Subscriptions:

None
When I login my page redirects to this ?tmpl=component&_=1377553507065 it only happens sometimes but is very bad when it happens.
The topic has been locked.
Support Specialist
I'm not sure what could be causing that or how it would be related to JFBConnect. The only time we ever set tmpl=component is if you have the Page Tab configuration set to display a Reveal Page *and* you are viewing the page within your Facebook.com Page.

I'm assuming that's not the case. As for the &_=1377553507065, I can't even think of what that might be. It's not your Facebook User ID. Can you check the Requests area of JFBConnect and see if you've configured any Requests? If so, can you check the notification history to see if any requests sent have that ID? There's really no reason we should be add '_' as a parameter key and that ID as a value..

If there's any more information you can provide, please do. My only suggestion is to clear your Joomla and browser caches and try again to see if that changes the behavior.

Thanks,
Alex
The topic has been locked.
Support Specialist
I just re-read your subject, you do mention "facebook page" in it.. can you let me know what your Facebook Page Tab is, if that is where you mean this is happening.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
10 years 8 months ago #35793 by chrmat1
ok I am able to replicate this error 100%...

This is a mixture of something with jfbconnect and jpayplans

if you go here isaerudition.com/ucf/ucf-study-pages/ucf-chemistry-i-2045 >>> *** you must choose another section i.e. section 1.2 and when that pages loads and you try to login the error occurs. it links to the actual item fullscreen
The topic has been locked.
Support Specialist
Christian,
Did a lot of testing on your page last night. Just to be clear, I'm seeing the redirect to the tmpl=component version of the page. It's not looping or throwing an error on that page, it just is missing the 'outer' area of your template and showing component content only, is that what you're seeing? Originally when you said 'keeps redirecting', I thought you meant there was a loop.

From what I can tell, when you click a different 'chapter', the contents are loaded through AJAX into the main component area of the page. The way it's happening looks very incorrect as it's not done through an iFrame *but* all the head section is being reloaded into the page. You can see this using the browser's developer tools.

In that head section is a re-declaration of our Javascript code, which is setting the 'return' URL to be that inner frame (just the content area), not the actual page itself. An AJAX udpate shouldn't be re-fetching all that information and spitting it into the page like it is, which is where the issue is coming from.

There's a few possible options to fix this:
* Fix whatever is doing the AJAX to not reload all the Javascript files, code, CSS and everything else that is currently happening.
* Switch the New/Returning User Redirection from "Same Page" to a fixed URL
* Modifying JFBConnect to somehow detect when it's on one of those AJAX pages and change it's behavior. This will be more difficult due to how the Javascript is all being re-inserted, but may be possible.. It also may cause other issues.

Let me know if the above helps get you started. We can help with the last one, but it will take more investigation to get you a real answer.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
10 years 8 months ago #35869 by chrmat1

There's a few possible options to fix this:
* Fix whatever is doing the AJAX to not reload all the Javascript files, code, CSS and everything else that is currently happening.


what file or files should be excluded from reloading?

The below code was added because this was happening for other situations as well. If I added the javascript file that is reloading to the script below would that help out?

Thanks. and since I didn't write the code would the correct way to do it be as such? >>> bootstrap|css >>> yourjsfile|js <<< Should I add a new line with that code?
data = data.replace (/<link.*?(bootstrap|css\-compiled\/master).*?(\/)?>\n/ig, "", data);
The topic has been locked.
Support Specialist
Christian,
The main portion of code that needs to be excluded would be our block that looks like:
jfbc.base = 'http://www.yourdomain.com/';
jfbc.return_url = 'L2ZvcnVtcy9qZmJjb25uZWN0L2pmYmNvbm5lY3Qtam9vbWxhLTI1LXN1cHBvcnQvNjk1OS1mYWNlYm9vay1wYWdlLWtlZXBzLXJlZGlyZWN0aW5nLWZvci10aGUtbmV3LXZlcnNpb24tNTE=';
jfbc.login.scope = 'email,publish_actions,user_location';
jfbc.login.show_modal = '0';
There's more after that as well, but that's a sample. There's other files you're loading like the Facebook Javascript library in the block with:
js.src = "//connect.facebook.net/en_GB/all.js";
and our jfbconnect.js file itself.

Those are files that definitely shouldn't be reloaded, but again, whatever's being called just shouldn't be calling all of the Joomla system plugins and doing what it's doing to render the page. If you fix this one case by excluding some files, I think you'll run into other issues later (with JFBConnect or something else).

I hope that helps get you started. Showing me the code for what you're doing really won't help because I don't know your site well enough to understand what should, or shouldn't happen. All I know is that re-inserting the head section and other stuff into the middle of the page is going to cause problems like you've seen.

Thanks,
Alex
The topic has been locked.