Forum is closed

Bug? JLinked not honoring "Hide Email Field on Registration"

Bug? JLinked not honoring "Hide Email Field on Registration"

Hello:  Tried attaching image, but system wouldn't let me (site relaunch?) 

In any case, I'm wondering if this is a known bug in JLinked?  Here's what's happening:
- I have the "Email Field on Registration" to "Hide", yet it still shows up on the front end.   
- I attempt to register using an email address *that is already used in the system*
- I see an error: "The email address you entered is already in use or invalid. Please enter another email address." But...
- NOW, the email address does NOT appear, so I have no way of entering a different email address.

Please help!

Thanks in advance.

Administrator has disabled public posting. Please login or register in order to proceed.

Re: Bug? JLinked not honoring "Hide Email Field on Registration"

The only time that JLinked will show the email address, if you have it set to hidden, is if the email address that LinkedIn is supplying is one that is already in use by someone on your site. In that case, we blank out the email field and let the user fill it in, like you mentioned. So, that isn't a bug.

However, if you submit and are getting the "email is in use" error message and *then* the field is hidden, that would be a bug since it should still remain visible and editable so the user can fix that problem.

Hope that helps explain,
Alex

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Offline
24163 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Bug? JLinked not honoring "Hide Email Field on Registration"

Hi Alex, thanks for the quick reply.  Makes sense about the email address showing in the case that the address is already registered.*

However, it appears that there is indeed a bug: as I described, upon submitting the form, the error message shows but then, the email field is no longer available.  Luckily, I think this is an edge case, but nonetheless, it's a bug. :-)  Please add it to your queue!

* Suggestion on this:  if the system detects that the email is already in use, it would be nice to show a message to this effect, something like, "Welcome, User.  It appears that the email address associated with your LinkedIn account has already been uses on [this site] to create an account.  Could it be that you already registered?  If not, please specify a different address to create your account."  (Overly wordy, but you get the idea...) 

Thanks!

Administrator has disabled public posting. Please login or register in order to proceed.

Re: Bug? JLinked not honoring "Hide Email Field on Registration"

Amy,
You are indeed correct. There is a bug in our code where if you use an email address that's already in the system *and* have 'hide email' enabled, once the form is submitted, the email field will be hidden.

The fix for this is to edit the /libraries/sourcecoast/utilities.php file. At the very bottom, you'll se a function called getDisplayEmail that looks like the following:

Code:

    static function getDisplayEmail($postData, $email, &$email1, &$email2)

    {
        $postEmail1 = SCUserUtilities::getPostData($postData, 'email1');
        $postEmail2 = SCUserUtilities::getPostData($postData, 'email2');

        if($postEmail1 != '' || $postEmail2 != '')
        {
            $email1 = $postEmail1;
            $email2 = $postEmail2;
        }
        else
        {
            $dbo = JFactory::getDBO();
            $query = "SELECT id FROM #__users WHERE email=" . $dbo->quote($email);
            $dbo->setQuery($query);
            $jEmail = $dbo->loadResult();
            if ($jEmail != null)
            {
                $email1 = "";
                $email2 = "";
            }
            else
            {
                $email1 = $email;
                $email2 = $email;
            }
        }
    }

Replace that entire block with this slightly revised one:

Code:

    static function getDisplayEmail($postData, $email, &$email1, &$email2)

    {
        $postEmail1 = SCUserUtilities::getPostData($postData, 'email1');
        $postEmail2 = SCUserUtilities::getPostData($postData, 'email2');

        if($postEmail1 != '' || $postEmail2 != '')
        {
            $email = $postEmail1;
            $email1 = $postEmail1;
            $email2 = $postEmail2;
        }
       
        $dbo = JFactory::getDBO();
        $query = "SELECT id FROM #__users WHERE email=" . $dbo->quote($email);
        $dbo->setQuery($query);
        $jEmail = $dbo->loadResult();
        if ($jEmail != null)
        {
            $email1 = "";
            $email2 = "";
        }
        else
        {
            $email1 = $email;
            $email2 = $email;
        }
    }

The specific changes aren't really important. Mainly, this will update the logic to always check the email against a user in the database, which we weren't doing previously. If that email address exists, the email fields will be blanked out and shown.

Please test and let us know how the change goes for you.

Thanks, and sorry for the inconvenience,
Alex

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Offline
24163 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Bug? JLinked not honoring "Hide Email Field on Registration"

Oh, and I like the idea of a notice at the top that the email is already in use. I've added that to our issue tracker (as well as the actual bug above). The bug will definitely be fixed in the next release. The notice is something we'll look into 'soon', but I can't guarantee when.

Thanks again,
Alex

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Offline
24163 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.
There are 0 guests also viewing this topic
There are 0 users also viewing this topic

Board Info

Board Stats
 
Total Topics:
11696
Total Polls:
0
Total Posts:
49100
Posts today:
1
User Info
 
Total Users:
47890
Newest User:
backpainremedie9
Members Online:
1
Guests Online:
981

Online: 
elef
Social Stream
SourceCoast Joomla Social Extensions
Friday, 25 May 2018
JFBConnect 8.0 Coming Soon! Stay tuned.
Refer and Earn

Like our extensions? You're not alone! That's why they're used on tens of thousands of websites. Now you can earn 20% of any sale you refer to SourceCoast.com.

We provide excellent documentation, well laid out sales pages and great support. All you need to do is spread the word and we'll take care of the rest.

Learn About Our Affiliate Program