Topic-icon required fields during registration is not considered by jfbconnect

Active Subscriptions:

None
8 years 11 months ago - 8 years 11 months ago #52899 by iozger
Hi,
I have 1 required field defined on Jomsocial profile. I am using facebook registration method provided by JFBConnect. I selected to show only required fields to show during registration through JFBConnect and it shows this required field properly when registering to site. Although it is required if the user does not fill anything for the field and proceeds, the registration is successful. And that required field is empty on users profile. It should not let the user proceed. Is it caused by JFBConnect or Jomsocial ?
Thank you
Last edit: 8 years 11 months ago by iozger.
The topic has been locked.
Support Specialist
My guess is that it's an issue with JFBConnect. However, we'd have to investigate further. To display the field, we use code directly from JomSocial:
CProfileLibrary::getFieldHTML($field)
That code should be inserting the 'required' tag and making sure its validated. We know this used to work, but it's possible there's been a change on their end where something new happened and it's not working now.

Can you let us know:
* What version of JomSocial you're using
* What type of field you've marked as required (text, radio, select, etc)

Then, we can setup a similar test on our development site and see if we can get to the bottom of the problem.

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

None
8 years 11 months ago - 8 years 11 months ago #52921 by iozger
Thank you Alex,
-I am using Jomsocial 4.0.2 and I also tested on Jomsocial 4.0.5 they both have same behaviours.

-The field is a multiple select. But I turned it into chosen multiple select by adding below lines in my template file;

JHtml::_('behavior.multiselect');
JHtml::_('formbehavior.chosen', 'select');

-I use JFBConnect v6.3
Last edit: 8 years 11 months ago by iozger.
The topic has been locked.
Active Subscriptions:

None
hi
any progress on this issue ?
The topic has been locked.
Support Specialist
Very sorry for the delay. We are looking into this and hoping to have an answer to you this weekend.

Thanks,
Alex
The topic has been locked.
Support Specialist
We just did a pretty thorough investigation into the multi-select box and found a few interesting/odd things. In short, it's going to be very difficult for us to fix this if you use the JFBConnect registration page. However, if you change the "Registration Component" option to JomSocial, the issue should go away as JomSocial will perform it's full validation on the field.

What's happening is that all other fields perform Javascript validation. That means that when you click the "Submit" button, if a required field isn't filled out, an immediate message is displayed under that field. JomSocial doesn't seem to perform any Javascript validation on multi-select fields and only validates them after the form has been submitted. This is very difficult for JFBConnect to do as we submit all the user account information at once, create the user profile and *then* import the profile data. Since the account is already created, validation doesn't really do very much.

For this reason, and many others, we added the option to use the JomSocial registration flow about a year ago. That allows the user to go through the same registration flow as all other users with profile information pre-filled (or pulled in the background) from the users social network. Using that option, the proper validation should be performed by JomSocial.

That's really the only suggestion I can give right now. We'd have to make some large overhauls to JFBConnect to perform the validation in the way JomSocial currently performs it, and that's not something that a) we could do quickly or b) really want to do as you're the first user that's run into this problem.

Hopefully the JomSocial registration flow option works for you, but if not, please let us know (and a bit of information on why).

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

None
8 years 9 months ago - 8 years 9 months ago #53822 by deivjstu
I think this is a major issue. Moreover, if I change registration component to JFBConnect, there's no way to find out which fields are required, .i.e. in the registration page they all look the same.
I can overcome this by modifying /plugins/socialprofiles/jomsocial/jomsocial.php, but I just hope that I'm missing something.

Second issue: after submitting the registration (without entering any required fields), the user either
1) successfuly creates the account (if using Facebook sign up)
2) get's weird red label (but not error message) - see the attachment. (if using Google sign up).

That's a very immature behavior. And I cannot turn to JomSocial registration because of inability to get rid of stupid password field. I really hope you can address these issues.
File Attachment:
Last edit: 8 years 9 months ago by deivjstu.
The topic has been locked.
Support Specialist
For the required fields, we use JomSocial's 'getRequiredField' function, which is supposed to automatically add the * in front of each required field. We'll have to investigate why that's not happening.

Second issue: after submitting the registration (without entering any required fields), the user either
1) successfuly creates the account (if using Facebook sign up)
2) get's weird red label (but not error message) - see the attachment. (if using Google sign up).

That's a very immature behavior. And I cannot turn to JomSocial registration because of inability to get rid of stupid password field. I really hope you can address these issues.

The red box is being placed there by the JomSocial validation. I'm unsure why it's not populated. Again, we'll have to investigate. However, if you add the following style to your template's CSS, it will highlight each field that gets the aria-invalid="false" with a red border.
[aria-invalid="false"] {
  border-color: red;
}
There's additional CSS you could use (temporarily) to hide the red box as well.

And I cannot turn to JomSocial registration because of inability to get rid of stupid password field.

This is an unfortunate side-effect of using JomSocial's flow. We can't 'force' a password into their field and the form won't submit without one. It's something we simply don't have control of, though I wish we did.

I hope that helps explain,
Alex
The topic has been locked.
Active Subscriptions:

None
i don`t prefer to use the jomsocial register flow because they have different flow. i would like to use JFBConnect`s flow.
My subscription for JFBConnect membership expires at the end of this month. And I have this issue. Will I be able to get a solution for this issue in the future even if i don`t renew my subscription?
The topic has been locked.
Support Specialist
iozger,
Sorry for the delayed response. We always recommend keeping your subscription up to date so that you can upgrade to the latest version. Each release generally has compatibility improvements for each of the social networks and 3rd party extensions (like JomSocial), which helps prevent issues from arising. Additionally, you'll be able to take advantage of the 30% discount before the subscription expires. Even if you don't, though, we'll gladly help get through any issues you encounter before your subscription expired.

As to the required fields, we have a fix we'd like for you to try out. To do so, you'll need to edit the /plugins/socialprofiles/jomsocial/jomsocial.php file. Around line 209, you'll see:
if ($showField)
                {
                    $hasVisibleFields = true;
                    $groupHtml .= '<dt>' . $field->name . "</dt><dd>" . CProfileLibrary::getFieldHTML($field) . "</dd>";
                }
Update that to:
if ($showField)
                {
                    $hasVisibleFields = true;
                    $groupHtml .= '<dt><span id="lblfield' . $field->id . '">' . JText::_( $field->name );
                    if ( $field->required == 1 ) {
                            $groupHtml .= ' <span class="joms-required">*</span>';
                    }
                    $groupHtml .= "</span></dt><dd>" . CProfileLibrary::getFieldHTML($field) . "</dd>";
                }
That should properly show the * next to required fields. We're unsure what version of JomSocial changed their output, but that code looks to fix things.

Please let us know how that goes. We'd love to get your confirmation on things and we plan to have this change incorporated into our next release as well.

Thanks,
Alex
The topic has been locked.