Topic-icon Cb and FAcebook registration: which triggers are hit?

Active Subscriptions:

None
Hi,

I am trying to find out which CB triggers are triggered on login via JFBConnect now that you have changed the registration process? The thing is that I need to have a MySQL query done upon first login of the user... The user used to hit that trigger but somehow do not do that anymore...

Bye

Tim
The topic has been locked.
Support Specialist
That's a good question. I don't think the triggers should have changed, but I can see (just at looking through the code) where we may be doing something slightly off.

We are saving the new user with a reason of 'edit', which should trigger the 'onBeforeUserUpdate'.

We could change our first save to be of type 'register', which would then trigger 'onBeforeUserRegistration'.

There was a change in JFBConnect v7.0 to fix some problems with required fields, but I think the triggers wouldn't have changed and that onBeforeUserUpdate would still have been called before, but I could be incorrect.

Let us know if that helps. Changing the save type from 'edit' to 'register' is also an easy thing to do if you'd like to test that.

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

None
Hi, yeah that would help really much and it would also make it more clear for future users as I have, logically set it to trigger only as OnAfterRegistration (so that it gets only triggered once during the lifetime of the profile). Having it as EDIT would trigger it every time someone edits it and thus loose its purpose...

Thanks,

Tim
The topic has been locked.
Support Specialist
To switch from 'edit' to 'register' is simple. However, CB is like a 376 headed snake with arms flailing in all directions. The change is below, but please, please, please test in many ways to make sure that this works as expected and doesn't cause any unforeseen issues.

The edit is in the /plugins/socialprofiles/communitybuilder/communitybuilder.php file. At line 241, you'll see:
$reason = "edit";
Change that to:
$reason = "register";

Please let us know how that goes!

Alex
The topic has been locked.
Active Subscriptions:

None
Hey Alex, it was me who had problems with the required fields and beforehand all of my auto actions used to work with JFBConnect and UserRegistration. I am not going to fumble around with it as I very strongly suspect that this trigger is the reason why the hidden field were causing the abortion of profile generation.

I will think of a different method to do it. CB is superbly useful but very very complex as you said :) .

Another question: We need to create a login from our app to CB (not too good) or through JFBConnect to CB. Is there an "attack-point" which we can target with the app? An API? Anything to basically just send the data from the app to JFBConnect? That way we wouldnt have 100.000 different connection systems (Joomla, CB, JFBC, IOS, Android etc...)
The topic has been locked.
Support Specialist
You weren't the only user with the required fields issue. The change above is still what we'd recommend to try though. The change we made for the required field issue was separate and really shouldn't break with that change.. but you'll need to test to ensure that's the case.

Another question: We need to create a login from our app to CB (not too good) or through JFBConnect to CB. Is there an "attack-point" which we can target with the app? An API? Anything to basically just send the data from the app to JFBConnect? That way we wouldnt have 100.000 different connection systems (Joomla, CB, JFBC, IOS, Android etc...)

Can you explain this a bit further? What do you mean 'our app'? Is this an iOS or Android custom application or something else? In general, you can redirect the users through the following API to have them register with any social network, but it requires the use of a browser to do so:
/index.php?option=com_jfbconnect&task=authenticate.login&provider=XYZ
Where provider = facebook,twitter,linkedin,etc

I hope that helps, but if you need anything else, please let us know.

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

None
10 years 6 days ago - 10 years 6 days ago #58452 by timchteure
Big big error done... I changed it by mistake on the live site and not on the dev site... If I just install JFBConnect freshly over it then it should be fine no? Or do you have a virgin file that you could shoot me over? Sorry...
Last edit: 10 years 6 days ago by timchteure.
The topic has been locked.
Active Subscriptions:

None
10 years 6 days ago - 10 years 6 days ago #58453 by timchteure
All fine. Had a back-up lying around... am hoping that it will work now.

Lesson learnt: changing the above triggers, causes problems....
Last edit: 10 years 6 days ago by timchteure.
The topic has been locked.
Support Specialist
Yeesh.. any information as to what kinds of problems you ran into when you tried that? We'll try to do more testing with calling the registration triggers, but can't guarantee we'll get it to work either.

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

None
Hey,
From my side there is no need to change the triggers anymore (dont change a working system...) If you want to change it anyway so that it hits "OnAfterRegistration" (the most logical one), then it would be great to have it (I like to clean up my logics as soon as possible as I know from bad experience how the problems multiply later on... from painful experience of having a website with a dozen visitors per site and then growing it to 2000 a day with legacy stuff still coming up). I have found a way to circumvent it.

Here is the problem that was caused by it: www.sourcecoast.com/forums/jfbconnect/jf...g-problems-with-jfbc
The topic has been locked.