Phone numbers

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
3/20/2015 7:59:48 AM
Gravatar
Total Posts 5

Phone numbers

I have written my own Register.aspx which replaces the original when my project is built.

One of the things it captures is PhoneNumber and it stores this in SiteUser.PhoneNumber.

Like FirstName and LastName, this field then gets stored in [dbo].[mp_Users]. It makes things a lot simpler and quicker for reporting pruposes if PhoneNumber can be stored linearly in the Users table as opposed to the UserProperties table.

I don't want to have to replace UserProfile.aspx so to make sure this field is available there, in my Profile.config file, I define it just like FirstName and LastName:

<add name="FirstName"
        type="System.String"
        allowMarkup="false"
        resourceFile="ProfileResourceCRC"
        labelResourceKey="FirstName"
        lazyLoad="false"
        showOnRegistration="true"
        requiredForRegistration="true"
        maxLength="100"
        columns="45"
        onlyAvailableForRoles=""
        onlyVisibleForRoles=""
        includeHelpLink="false"
        cssClass="widetextbox"
        />

    <add name="LastName"
        type="System.String"
        allowMarkup="false"
        resourceFile="ProfileResourceCRC"
        labelResourceKey="LastName"
        lazyLoad="false"
        showOnRegistration="true"
        requiredForRegistration="true"
        maxLength="100"
        columns="45"
        onlyAvailableForRoles=""
        onlyVisibleForRoles=""
        includeHelpLink="false"
        cssClass="widetextbox"
        />

    <add name="PhoneNumber"
        type="System.String"
        allowMarkup="false"
        resourceFile="ProfileResourceCRC"
        labelResourceKey="PhoneNumber"
        lazyLoad="false"
        showOnRegistration="true"
        requiredForRegistration="false"
        maxLength="100"
        columns="45"
        onlyAvailableForRoles=""
        onlyVisibleForRoles=""
        includeHelpLink="false"
        cssClass="widetextbox"
        />

This causes the field to show on UserProfile.aspx but while FirstName and LastName are being loaded from [dbo].[mp_Users], it is attempting to load PhoneNumber from [dbo].[mp_UserProperties] and so it is showing an empty field.

When I enter a value and click save, it now saves it to the table where I don't want it to appear ([dbo].[mp_UserProperties]) instead of overwriting the value that I signed up with in [dbo].[mp_Users]

It appears that PhoneNumber is being treated as an extensible property instead of one of the default properties (like FirstName and LastName)

This should be an easy fix that requires two small changes to SiteUser.cs

Within public void SetProperty(String propertyName, Object propertyValue, SettingsSerializeAs serializeAs, bool lazyLoad), add the following case block:

                case "PhoneNumber":
                    if (propertyValue is String)
                    {
                        this.PhoneNumber = propertyValue.ToString();
                        this.Save();
                    }
                    break;

Within public void GetProperty(String propertyName, SettingsSerializeAs serializeAs, bool lazyLoad), add the following case block:

                case "PhoneNumber":
                    return this.PhoneNumber;

Do you think this can be included as part of the next release? 

Thanks!

3/20/2015 12:34:00 PM
Gravatar
Total Posts 18439

Re: Phone numbers

This is now implemented in the source code repository so it will be in the next release.

Hope that helps,

Joe

3/21/2015 1:43:51 AM
Gravatar
Total Posts 5

Re: Phone numbers

Thanks Joe!

 

You must sign in to post in the forums. This thread is closed to new posts.