× Joomla Facebook Connect support forum

Topic-icon New Error [SOLVED]

Active Subscriptions:

None
14 years 5 months ago #17169 by fb_100001229590578
I am getting this error in virtuemart with JFBconnect enabled for filmpositivesnow.com
missing : after property id
[Break On This Error] FB.init({appId: '276899789025909', sta...m_jfbconnect/assets/jfbcchannel.php'})
film-p...x18-pap (line 228)

I am using chrono forms as a custom attribute for virtumart. When I submit the form I get the above error and the form does not submit. It works fine when JFBConnect plugins are disabled. Currently I have the plugins disabled as the site can not be used with it enabled.
The topic has been locked.
Support Specialist
14 years 5 months ago #17175 by alzander
Replied by alzander on topic New Error [SOLVED]
Jeremy,
Not sure what that error is. We've never heard of that one before, and there's no "id" property in the line of code that you mention. That initializes the Facebook Javascript library, and is definitely critical to Facebook's proper functionality, but shouldn't be causing a problem like you show.

Without seeing the code itself (or the error), it's tough to diagnose. Is there a dev site you might have enabled, or some other way we can enable the plugins to see what's happening?

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

None
14 years 5 months ago #17178 by fb_100001229590578
I have reenabled the plugins, you can log in with:
***** And *****.

You can select any of the four products and select tab "2" and fill out the form with any values and submit the form. That is where you will see the error.

Thanks!
The topic has been locked.
Support Specialist
14 years 5 months ago #17181 by alzander
Replied by alzander on topic New Error [SOLVED]
Jeremy,
Not exactly sure what's going wrong. Facebook is very Javascript dependent, so any errors or issues with the Javascript on the page can give it some heartburn... which can then cause other Javascript (like your form) to have it's own issues.

There wasn't anything drastically wrong with the Javascript on the page, but I did find one thing that wasn't quite right either. I'm not sure if you have the ability to fix it as I'm not sure what extension is inserting the code, but I'll explain best I can. I'm also currently blocked from your site for trying to submit the form too much: "You are a have been flagged as a spammer, hacker due to too many failed login attempts or other bad behavior. Please try again in 10 minutes. If you feel you have received this in error please contact us."

Anyways, if you open the HTML on the page and search for the following code, you'll see that the end of this function ends in closing parenthesis without any semicolon. It should have a semicolon to properly close the function. If you look for any other window.addEvent blocks, you'll see they properly end with a semicolon:
window.addEvent('domready', function () {
    var formattr = $('Form-id_field');
    ..... about 25 or so lines ...
               document.addtocart.submit();
            }
        });
    }
})  <---- This should end with a ;
function BixFormUpdate() {
I honestly don't know if adding the semicolon there will fix the issue, but it's very possible it may. The JS error I see in Chrome does say something about a weird closing parenthesis, but it references a line that is unrelated to the above (and doesn't even have any parenthesis's), so very strange all around.

Hope that helps get you started with something. Obviously, if that doesn't work, let us know, and we'll gladly look further into the issue. Everything else on the page looks good.. no other conflicts, other Facebook extensions, or anything else that are common problems.

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

None
14 years 5 months ago #17187 by fb_100001229590578
I have unblocked you and also turned off the firewall so hopefully you won't get blocked again. The extension is bixie vm chrono forms which is an extension from bixie.nl which uses chronoforms as an advanced attribute. The code should be coming from this module. I have briefly look at one of the files and found why i beleive the area is which you have shown but it looks a little different and im not very familiar with how the code should be. The deveolper of the module seems to have either left the planet or just abandoned it altogether. I can send you ftp access amd admin access if you need it. Thanks!
The topic has been locked.
Active Subscriptions:

None
14 years 5 months ago #17196 by fb_100001229590578
I added the semicolon and now i get this in chrome:
Uncaught SyntaxError: Unexpected token )
BixformDonefilm-positive-13x18-pap:225
film-positive-13x18-pap:225Uncaught SyntaxError: Unexpected token .
BixformDonefilm-positive-13x18-pap:225
FB.provide.insertIframeall.js:6
FB.provide._insertIframeall.js:22
FB.provide.hiddenall.js:22
FB.provide.uiall.js:22
FB.provide.getLoginStatusall.js:23
FB.provide.initall.js:27
window.fbAsyncInitindex.php:79
FB.provide.NATIVE_READY_EVENTall.js:36

And I still can not complete the form.
The topic has been locked.
Active Subscriptions:

None
14 years 5 months ago #17213 by fb_100001229590578
Is there anyway to keep it from loading on specific pages or on pages with specific components like in the advanced module manager from no number? Or perhaps only load on the home page?
The topic has been locked.
Support Specialist
14 years 5 months ago #17217 by alzander
Replied by alzander on topic New Error [SOLVED]
Jeremy,
Sorry for the delay in getting back to you. I'm really clueless as to what's happening. Obviously, there's some conflict between the Javascript from your other extension and Facebook's Javascript library. We don't have any way to easily disable the Facebook Library from loading on the page, but with the code change below, you can do it yourself.

You'll need to edit the /plugins/system/jfbcsystem.php file, go to around line 119 and you should see the declaration for the function "_getJavascript". Add the following lines to the very top of this function (right after the initial { character):
private function _getJavascript($appId, $fbLocale)
{
    if (JRequest::getCmd('option') == "XXX" && JRequest::getCmd('view') == "YYY") // ADD THIS
        return ""; // ADD THIS

    // Get the language to use
    if ($fbLocale == '')
For the XXX and YYY, you'll need to know the internal Joomla URL for the pages that the form can appear on. The best way to do this is simply disable SEF URLs (temporarily) and navigate to the page. The URL will be something like:
index.php?option=XXX&view=YYY&id=ZZ&....

If view isn't there, or the above line isn't specific enough, paste a few of the non-SEF URLs from different order pages and we can help you make the query target just those pages.

Hope that all makes sense, but if not, let us know. Sorry for all the trouble, but we'll get you going soon!

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

None
14 years 5 months ago #17219 by fb_100001229590578
Thanks, I tried it a few different ways and it didn't seem to work. This is what I have so far (I included some code before and after what i have to make sure it is in the right area:

if ($replace)
{
$description = trim($description);
$doc->setDescription($description);
}
}

private function _getJavascript($appId, $fbLocale)

{

if (JRequest::getCmd('option') == "com_virtuemart" && JRequest::getCmd('category_id') == "9") // ADD THIS

return ""; // ADD THIS



// Get the language to use

if ($fbLocale == '')

{
$lang = JFactory::getLanguage();
$locale = $lang->getTag();
$locale = str_replace("-", "_", $locale);
}
else
{
$locale = $fbLocale;
These are some of the urls:
www.filmpositivesnow.com/index.php?page=...irtuemart&Itemid=213
www.filmpositivesnow.com/index.php?page=...irtuemart&Itemid=213
www.filmpositivesnow.com/index.php?page=...irtuemart&Itemid=213
// Get the language to use

if ($fbLocale == '')
Thanks for all the help!
The topic has been locked.
Support Specialist
14 years 5 months ago #17222 by alzander
Replied by alzander on topic New Error [SOLVED]
Alright Jeremy, we're fixing you up today, like it or not! :D

From your URLs, I'm not seeing the category_id parameter in the URL at all. I know that's how it may be configured in Virtuemart, but if it's not in the URL, we can't test with it. However, you can use the product_id which is all 3, though different each time. Please try the following:
if (JRequest::getCmd('option') == "com_virtuemart" && (JRequest::getCmd('product_id') == "34" || JRequest::getCmd('product_id') == "36" || JRequest::getCmd('product_id') == "38"))
        return "";
That basically is saying, "If we're in virtuemart, and the product is 34, 36, OR 38, don't do anything".

Hopefully that works, but obviously, test that it doesn't break things on other pages related to those products. If so, we should be able to narrow things down further.

Oh yeah, please disable all cache while testing this. Once it's working, you can re-enable caching.

Thanks,
Alex
The topic has been locked.