Products

Solutions

Learn More

Partners

Community

Blog

About

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesStrange issue with profile propertiesStrange issue with profile properties
Previous
 
Next
New Post
9/15/2016 10:24 AM
 

Hi, .... Just tried making a new little module in dnn 8 in which a user can update his profile. 

The strange thing is, that the code that used to work in older versions does not seem to work anymore.
Whenever I do something like :

currentuser.Profile.SetProfileProperty("Company", txtCompany.Text.Trim());

And then:

UserController.UpdateUser(PortalId, currentuser);

It does not work.
I mean, occasionally it does, but most of the time it doesn't.
So it looks like DNN doesn't think it needs to run the update.
Also tried to trace the SQL queries, and it does call updateuser, however it does nothing with the profile.
Also when I try stuff like: ProfileController.UpdateUserProfile(...etc.
So anyone knows what's going on here?

 
New Post
9/16/2016 3:53 AM
 
Just tested it with a small module;

UserInfo currentuser;

protected void Page_Load(object sender, EventArgs e)
{
lblMessage.Text = "Update city";

currentuser = UserController.GetUserById(PortalId, UserInfo.UserID);

if (currentuser != null)
{
lblMessage.Text += "
For user: " + currentuser.Username;
if (currentuser.Profile.City != "")
{
lblMessage.Text += "
Current: " + currentuser.Profile.City;
}
else
{
lblMessage.Text += "
No city field found... ";
}

String newvalue= DateTime.Now.ToShortTimeString();
currentuser.Profile.City = newvalue;

UserController.UpdateUser(PortalId, currentuser);
lblMessage.Text += "
New value: " + newvalue;
}
else
{
lblMessage.Text += "
No user " ;
}
}

And it might work the first time, but after trying it again, the value stays the same.
So is this a bug in DNN 8 ?
 
New Post
9/19/2016 7:44 AM
 
Hmm.....
No one?
Really?
 
New Post
9/20/2016 9:24 AM
 
Really really?
 
New Post
9/20/2016 10:56 AM
 
I cannot answer your question, but assuming the DNN pages for editing this stuff actually work, did you try looking in the source code to see how they do it?

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesStrange issue with profile propertiesStrange issue with profile properties


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out