coral
  • Posts: 37
  • Joined: 09/05/2013
Hi all

I have recently installed yaf 2 (clean install) on 1&1 hosting - .Net 4 and Microsoft sql server 2012 and I have an issue with user profile saving.
When users go to edit profile page, make some changes and hit save nothing would happen; no error message no postback and no saving. I don't have this problem when I test it in a local machine with sql server express. Any idea what might be the cause of this and how to solve it?

I haven't changed any default provider in web.config file.

I appreciate your help.
Sponsor
squirrel
  • Posts: 925
  • Joined: 14/01/2010
Is this the only function that fails is saving a profile? And you say no postback, what browser and version? Have you tried an alternate browser?
If you can't find it using the forum search, try my signature link -- searches this site using Google: Google is my Friend 
coral
  • Posts: 37
  • Joined: 09/05/2013
Thank you for your reply.

I have tried it in Mozilla firefox 25.0.1 and internet explorer 10.

I haven't tested all the features yet but so far, saving new password for ordinary users doesn't work either.

When I try to change the password for non-admin user I am asked to confirm which user I am changing the password for and in the list there isn't the user who is logged in instead I have these 3 items:
one item is "<>"
email address of admin
username of admin

By the way profile can be updated from admin menu but not from the user own My Profile page.


Following features working fine for all users:
posting
sending private message
changing signature, picture, album
squirrel
  • Posts: 925
  • Joined: 14/01/2010
What error is profile editing causing normal users? Without error message hard to diagnose. Check browser web console (developer tools) - look for errors. Is site integrated with another site? On production server, is YAF in a subfolder, seperate virtual application, or is it having it's settings trumped by a parent web.config?

Passwords do not reset for normal users until they confirm them in email if I remember correctly. Are you using 'email confirmations' and is your mail server working properly? You may try disabling 'email verification' in the host settings. See normal user can then make changes - if so, it's waiting for email confirmation before it changes to new PW. Same with Email addresses - only admins can override that in admin user editor. If admin changes email or password - poof - it's set.


If there's no postback, look for javascript errors in browser...

If you can't find it using the forum search, try my signature link -- searches this site using Google: Google is my Friend 
tha_watcha
  • Posts: 4116
  • Joined: 06/03/2010
Quote:

I have recently installed yaf 2 (clean install) on 1&1 hosting - .Net 4 and Microsoft sql server 2012 and I have an issue with user profile saving.
When users go to edit profile page, make some changes and hit save nothing would happen; no error message no postback and no saving.



This also happens on this forum. There should be an error logged in the event log.
UserPostedImage
coral
  • Posts: 37
  • Joined: 09/05/2013
Thanks to your hint I found the cause of the problem. It was related to using Farsi (shamsi) calendar for forum. It seems that it couldn't validate the data but it didn't give any error message to realise what is going on. Unticking the option (Use Farsi (Shamsi) Persian Calendar) in the host setting solved the problem. Now I have to investigate deeper to find out how to solve this problem.
Many thanks for your speedy replies.
coral
  • Posts: 37
  • Joined: 09/05/2013
I added an exception handler to that part of code so it can override the error. But the thing that I don't understand is why birthday box doesn't accept date in any format neither with Farsi calendar setting nor oridinary calender. The strange thing is that it is working fine in local host. Any idea what might be different in remote server?
tha_watcha
  • Posts: 4116
  • Joined: 06/03/2010
Originally Posted by: coral

I added an exception handler to that part of code so it can override the error. But the thing that I don't understand is why birthday box doesn't accept date in any format neither with Farsi calendar setting nor oridinary calender. The strange thing is that it is working fine in local host. Any idea what might be different in remote server?



Can you post the error from the event log here?

Did you use the date picker or did you enter the date manually?


UserPostedImage
coral
  • Posts: 37
  • Joined: 09/05/2013
This was the error message I got when I used it with Farsi Calendar before I add the exception handler:

Exception FarsiLibrary.Exceptions.InvalidPersianDateFormatException: Can not parse the value. Format is incorrect. at FarsiLibrary.PersianDate.Parse(String value) at YAF.Controls.EditUsersProfile.UpdateUserProfile(String userName) at YAF.Controls.EditUsersProfile.UpdateProfile_Click(Object sender, EventArgs e) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

But even when I use it without farsi calendar, birthday date does'nt save when updating profile although other changes are saved and there is no error message. As I said before, I don't have this problem at local machine.

As for date picker, it doesn't show up even when it is enabled in host setting.
coral
  • Posts: 37
  • Joined: 09/05/2013
It is related to jquery, date picker. Although It is not displayed.

When I comment out the following part of code in controls/EditUserProfile.ascx.cs it works fine for both Farsi and ordinary calendar.

 protected override void OnPreRender([NotNull] EventArgs e)
        {
            //// setup jQuery and DatePicker JS...
            YafContext.Current.PageElements.RegisterJQuery();
            YafContext.Current.PageElements.RegisterJQueryUI();

            //var ci = CultureInfo.CreateSpecificCulture(this.GetCulture(true));

            //if (!string.IsNullOrEmpty(this.GetText("COMMON", "CAL_JQ_CULTURE")))
            //{
            //    YafContext.Current.PageElements.RegisterJQueryUILanguageFile();

            //    if (ci.IsFarsiCulture())
            //    {
            //        YafContext.Current.PageElements.RegisterJsResourceInclude(
            //            "datepicker-farsi", "js/jquery.ui.datepicker-farsi.js");
            //    }
            //}

            //YafContext.Current.PageElements.RegisterJsBlockStartup(
            //    "DatePickerJs",
            //    JavaScriptBlocks.DatePickerLoadJs(
            //        this.Birthday.ClientID,
            //        this.GetText("COMMON", "CAL_JQ_CULTURE_DFORMAT"),
            //        this.GetText("COMMON", "CAL_JQ_CULTURE")));

            YafContext.Current.PageElements.RegisterJsResourceInclude("msdropdown", "js/jquery.msDropDown.js");

            YafContext.Current.PageElements.RegisterJsBlockStartup(
                "dropDownJs", JavaScriptBlocks.DropDownLoadJs(this.Country.ClientID));

...
coral
  • Posts: 37
  • Joined: 09/05/2013
I have changed the following part of code in controls/EditUserProfile.ascx.cs it works fine for both Farsi and English calendar in local host. Although I have not had date picker for Farsi calendar yet.

old code:


protected override void OnPreRender([NotNull] EventArgs e)
        {
            //// setup jQuery and DatePicker JS...
            YafContext.Current.PageElements.RegisterJQuery();
            YafContext.Current.PageElements.RegisterJQueryUI();


            var ci = CultureInfo.CreateSpecificCulture(this.GetCulture(true));

            if (!string.IsNullOrEmpty(this.GetText("COMMON", "CAL_JQ_CULTURE")))
            {
                YafContext.Current.PageElements.RegisterJQueryUILanguageFile();

                if (ci.IsFarsiCulture())
                {
                    YafContext.Current.PageElements.RegisterJsResourceInclude(
                        "datepicker-farsi", "js/jquery.ui.datepicker-farsi.js");
                }
            }


new code:


protected override void OnPreRender([NotNull] EventArgs e)
        {
            //// setup jQuery and DatePicker JS...
            YafContext.Current.PageElements.RegisterJQuery();
            YafContext.Current.PageElements.RegisterJQueryUI();

            var ci = CultureInfo.CreateSpecificCulture(this.GetCulture(true)); 

            if (!string.IsNullOrEmpty(this.GetText("COMMON", "CAL_JQ_CULTURE")))
            {
                if (ci.IsFarsiCulture())
                {
                    YafContext.Current.PageElements.RegisterJsResourceInclude(
                        "datepicker-farsi", "js/jquery.ui.datepicker-farsi.js");
                }
                else
                {
                    YafContext.Current.PageElements.RegisterJQueryUILanguageFile();
                }

                
            }
coral
  • Posts: 37
  • Joined: 09/05/2013

My forum culture (board setting) is set to Farsi both at local and remote host. But when I run the app in remote host the culture seems to be Arabic instead of Farsi, because the date shown is in Arabic fromat, whereas at local host the date shown is in Farsi format.

The option of using Farsi calendar is unticked at both of them. Any idea why the culture is different and how I can make sure that it is set to Farsi and not to Arabic?
tha_watcha
  • Posts: 4116
  • Joined: 06/03/2010
Originally Posted by: coral

I have changed the following part of code in controls/EditUserProfile.ascx.cs it works fine for both Farsi and English calendar in local host. Although I have not had date picker for Farsi calendar yet.



This can not work, you changed the code so that the datepicker script is not loaded when using farsi.

The jquery.ui.datepicker-farsi.js js file that is only an addon for the datepicker and is currently out of date, and did not support the latest version of jquery-ui.

However i committed an updated version of that file, the datepicker should now work with farsi and the latest commit

https://github.com/YAFNE...d459e3fc43d6552e5761e062 

UserPostedImage
coral
  • Posts: 37
  • Joined: 09/05/2013

The date picker is displayed now for English date, but I haven't had the farsi date picker yet.

Another problem is: When the edit profile page is opened the value of birthday text box will disapear. Althoug it has been saved before.
coral
  • Posts: 37
  • Joined: 09/05/2013
In addition to Farsi datepicker not displaying (which I don't mind that much), updating profile still give the same error at remote server when the forum uses Farsi calendar.

Quote:

Exception FarsiLibrary.Exceptions.InvalidPersianDateFormatException: Can not parse the value. Format is incorrect. at FarsiLibrary.PersianDate.Parse(String value) at YAF.Controls.EditUsersProfile.UpdateUserProfile(String userName) at YAF.Controls.EditUsersProfile.UpdateProfile_Click(Object sender, EventArgs e) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint



And I still don't know why birthday can be saved at local host but not at remote server.


Besides, Is it not possible for users to see an invalid data error (like for other profile fields) when the date is not right?
Users browsing this topic
    Forum Jump  
    • You cannot post new topics in this forum.
    • You cannot reply to topics in this forum.
    • You cannot delete your posts in this forum.
    • You cannot edit your posts in this forum.
    • You cannot create polls in this forum.
    • You cannot vote in polls in this forum.

    About Us

    The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

    Powered by Resharper Donate with PayPal button

    Project Twitter Updates

    Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved