× Joomla LinkedIn support forum

Topic-icon Error on Jlinked registration-Missing argument 4 for CProfile::validat

Active Subscriptions:

None
When logging in with LinkedIn (full profile), and when "Show Non-Mapped Required Fields" is set to yes the following error occurs.

Warning: Missing argument 4 for CProfile::validateField(), called in /alpha/plugins/jlinkedprofiles/jomsocial.php on line 195 and defined in /alpha/components/com_community/libraries/profile.php on line 122

Let me know what this can be. Thanks!
The topic has been locked.
Active Subscriptions:

None
Looks like I've solved it, just fyi:

RANDOM ERROR 1: If "Non-Mapped Required Fields" were mapped but not set to "required" you get the following error (actually like 20 of them):
Warning: Missing argument 4 for CProfile::validateField(), called in /alpha/plugins/jlinkedprofiles/jomsocial.php on line 195 and defined in /alpha/components/com_community/libraries/profile.php on line 122

RANDOM ERROR 2: If "Show Non-Mapped Required Fields" is ON but no fields are actually mapped you get the following error (or again a whole bunch of them):
Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /alpha/plugins/jlinkedprofiles/jomsocial.php on line 99

Took a bunch of trial and error to figure this out. These issues could probably do with a graceful fail. :-/

Hope that helps the next guy.
The topic has been locked.
Support Specialist
Thanks for the notice. Not sure where that's coming from. Are you using JS 2.4? We run our tests with error reporting set to maximum, so we should have seen that.. but for the JLinked 1.0 release, JomSocial 2.2 was only out at the time. Possible it's a 2.4 thing.. possible we missed it.

JLinked 1.1 is going to have a lot of profile improvements, much of which is coming from yours (and some others) feedback. This will definitely be investigated then. Obviously, if it's causing you any critical issues now, let us know.

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

None
No, this is JS 2.2. Once that stuff got enabled it looks like it's gone.
The topic has been locked.
Active Subscriptions:

None
Ok, I figured out what the issue is with this error, because it kept recurring over and over and took a long time to figure out.

The issue is some problem in compatibility between JLinked and XIUS (extended user search by joomlaxi.com) - I don't know why this is occurring with Jlinked but not JFBC, but that's appears to be the issue. Here is the way to recreate it:

JLinked: set to "show non-mapped required user fields" using "full profiles"
XIUS: appropriate plugins enabled

Once a user tries to create an account with Jlinked they hit a large sequence of recurring errors:
Warning: Missing argument 4 for CProfile::validateField(), called in /alpha/plugins/jlinkedprofiles/jomsocial.php on line 195 and defined in /alpha/components/com_community/libraries/profile.php on line 122

Followed by an error that states XIUS failed in the last line (didn't write that one down). Disabling XIUS appears to fix the issue, but I have not explored the cause. Anyway, this is an FYI of this issue if it comes up again - took a long time to figure out, and again, not sure why there is no problem with JFBC (no problem logging in to the same system using JFBC).

Cheers!
The topic has been locked.
Support Specialist
Joe,
I hate that it's taken this long to get back to this post, and that you were having that issue in the first place.

We were debugging an unrelated issue with the JomSocial profile plugin for JFBConnect, and noticed an issue with the validateField call that you mention above. I'm honestly not sure if you're still having this issue, or if you worked around it. Either way, with the 4.1.1 release of JFBConnect (due out in a few hours), there's an updated JomSocial profile plugin which fixes the validateField function. A similar fix can be done in the LinkedIn / JomSocial profile plugin if needed (and will be included in an upcoming release).

In the /plugins/jlinkedprofiles/jomsocial.php file, at the line in your error above (you've modified the plugin, so it's different than the released version), update the call to:
if (!CProfileLibrary::validateField($data['id'], $data['type'], $values[$data['id']], 0))
The difference is the addition of the first parameter $data.

We have done the regression yet to figure out if this was a change in JomSocial we missed, or an error that's been present in the plugin for a while. That function validates the field to make sure it conforms to any settings in JomSocial you have for it (for example, a birthday is before 2000 or a text field is at least 10 chars). Without that change, the validation basically always returns 'true', but also throws that warning.

Again, sorry for the delay on swinging back to this and the effort you had to put into it. Hope the above helps though.

Thanks,
Alex
The topic has been locked.