Event Calander

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.
9/2/2008 2:45:21 PM
Gravatar
Total Posts 104

Event Calander

Hi,

I use a calander in my mooportal and also portal language is Farsi, when I try to add an event , I get this error message , also now I can't open the page that has this module after I try to add event:

this is the System Log:

Would you please help me to fix it?

2008-09-02 21:33:09,363 [6268] ERROR mojoPortal.Web.mojoBasePage [(null)] - 193.178.201.67-fa-IR - /TermSch.aspx
System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at System.DateTime.Parse(String s, IFormatProvider provider)
at System.Data.ConstNode..ctor(DataTable table, ValueType type, Object constant, Boolean fParseQuotes)
at System.Data.ExpressionParser.Parse()
at System.Data.DataExpression..ctor(DataTable table, String expression, Type type)
at System.Data.DataView.set_RowFilter(String value)
at mojoPortal.Web.Controls.DataCalendar.OnDayRender(TableCell cell, CalendarDay day)
at System.Web.UI.WebControls.Calendar.RenderDays(HtmlTextWriter writer, DateTime firstDay, DateTime visibleDate, CalendarSelectionMode selectionMode, Boolean buttonsActive, Boolean useAccessibleHeader)
at System.Web.UI.WebControls.Calendar.Render(HtmlTextWriter writer)
at mojoPortal.Web.Controls.DataCalendar.Render(HtmlTextWriter html)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer)
at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Control.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Control.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer)
at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Control.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Page.Render(HtmlTextWriter writer)
at mojoPortal.Web.mojoBasePage.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
 

 

PS . Is there any way that I force mojoportal to use only farsi language and not using browser settings?

9/2/2008 3:14:40 PM
Gravatar
Total Posts 18439

Re: Event Calander

Hi,

I was able to produce this error on my machine by changing my browser language to Persian and adding an event to the calendar. I did manage to fix it so the error doesn't happen. If you are a develooper, the fix for this will be in svn trunk by later tonight sometime, for everyone else it will be fixed when I make the next release.

It is possible to specify a culture instead of using the browser settings as documented here:

http://www.mojoportal.com/localization.aspx

However, it won't work if you set it to a default culture that has not been fully translated, you will probably get null reference exception if there are missing keys in the default resource files. I'm 100% sure our Persian translation is missing some keys so you would need to find all the missing ones (by comparing to the English resource files) and update the resource files to fill in the missing keys. If you do that, please send me the updated files so I can include them in mojoportal.

Hope it helps,

Joe

9/3/2008 12:27:08 AM
Gravatar
Total Posts 104

Re: Event Calander

Thanks for your response.

As soon as I update Persian resources files I will send them.

I find some other bug in Persian language and Calander ( Blog Module ) I will send more details soon.

9/3/2008 12:58:38 AM
Gravatar
Total Posts 104

Re: Event Calander

In Blog module , when we use Persian language and check the Show Archive , there is a bug.

in this case we see a list of months , Month an Year didnt convert to Persian Calander but using Persian name for month.

For Example , for August 2008 , write  آبانo 2008 , which آبان (ABAN ) is  the name of 8'th month in persian calander.

it most chaneg to مرداد 1387 which مرداد is name of 5'th month is Persian Calander ( around 21 July - 21 Aug) .

Sorry for my bad english :)

9/3/2008 9:59:54 AM
Gravatar
Total Posts 550

Re: Event Calander

Hi Ashian

 I treid to solve archives  in blog module , but some SQL function needs in database side (becuase perisan months and English months not match  ),but after negusciate with joe audette , he do'nt agree to merge these funtion in the core of mojoportal.So I may be decide to distribute  a Persian Pack for customizie Persian Language. Feel free to ask you question form me.

I hope to help you.

 

 

9/3/2008 3:29:53 PM
Gravatar
Total Posts 18439

Re: Event Calander

Hi Ashian and Hi Asad,

I implemented a solution for this problem today without making any changes to the database. My fix will be in svn trunk later tonight so you can test it and tell me if it is solved correctly. I'm not sure about the year because it came out as 2008 = 1386 (you said it should be 1387 so maybe I'm off by one year?)

Asad, the reason I did not want to integrate the sql changes is because I don't think we need to solve this problem in the database, it can be solved outside the database and this will be better because we have 5 different databases and I don't want the complexity of having 5 different solutions.

I added a few methods to PersianDateHelper.cs to achieve this solution. As I mentioned above I'm not sure I got the year calculation right so it may need a little tweaking to fix it.

Let me know after you test it if it still needs fixing.

Best,

Joe

9/5/2008 3:57:15 AM
Gravatar
Total Posts 550

Re: Event Calander

Hi Joe
First of all I thank you for attention to my Language (Persian).I tests your effort to solve my problem in blog module. Months appear correctly but years are incorrect. I inform you that 1387 not exactly equal 2008 but 1387 start from Match of 2008 and finish in March 2009.So 1387 float in 2008 and 2009.
Thanks again.
Best Regards
Asad
 

9/5/2008 7:17:50 AM
Gravatar
Total Posts 18439

Re: Event Calander

Hi Asad,

I made a few fixes that seem to solve the year problem. My changes will be in svn trunk by tonight.

Best,

Joe

9/6/2008 7:30:17 AM
Gravatar
Total Posts 104

Re: Event Calander

Hi Joe,

thanks for your attention.as I see in your site , year and month are correct.

hope I can complete the Persian Language pack soon , then I will send you.

Best wishes

Mehdi Alidoost

Ashian ICT Solutions

9/6/2008 8:00:50 AM
Gravatar
Total Posts 18439

Re: Event Calander

Hi Mehdi,

I forgot to mention before, there are also files to translate in the Web/Data/MessageTemplates folder.

Thanks for your help in updating the Persian translation. You may also wish to coordinate your efforts with Asad, because he made the Persian translations we have now.

Best,

Joe

9/6/2008 8:26:40 AM
Gravatar
Total Posts 104

Re: Event Calander

Ok,

I read current translation and will update them ( non translated and also some update for current translations ) after finishing I will send them to you and Asad , hope we have a complete Persain Language pack then.

best wishes

Mehdi Alidoost

9/6/2008 9:54:49 AM
Gravatar
Total Posts 550

Re: Event Calander

Hi Joe
I test and review your solution for archived items in the Blog Module. Unfortunately your effort not solve problem. If look at mojoportal change blog you see that 2 items has been sent in 6th month of Persian calendar but in right side we see 1 Item for 6th month ((1) شهريور 1387), because another Item has been sent in August.
Only thing that is the same in two Calendars (Persian and English) is match of days:
Saturday=شنبه, Sunday=یکشنبه, Monday=دوشنبه, Tuesday=سه شنبه, Wednesday=چهارشنبه, Thursday=پنجشنبه.
As you know I convert a date (for example 20008/09/06) to equivalent Persian date (1387/06/16) in Blog and Forum modules in UI layer. But when we retrieve an aggregation selection from database we need a function that converts English date to Persian Date for any record in SELECT instruction.
For sum up in my opinion we have to apply a SQL function when we retrieve an aggregation selection from database.
Since I can't insert image in this forum I sent you this text with an image that depict overlapping of months and years in the two calendars.
 

Best Regards

Asad

9/6/2008 2:27:43 PM
Gravatar
Total Posts 18439

Re: Event Calander

Hi Asad,

I see you are correct, to make it come out perfect it  would need to be grouped correctly in the database. I will consider integrating your database changes. I noticed before you have some User Defined Functions in the sql script, my only concern is whether it will break compatibility with SQL 2000. Do you have access to a machine running SQL 2000 that you can test the script on to verify its compatible? If we can be sure it is compatible I will have more confidence to integrate it.

Best,

Joe

9/7/2008 5:31:57 AM
Gravatar
Total Posts 104

Re: Event Calander

Hi Joe , Hi Asad.

Today I can update my source code and check your changes , I'm agree with Asad's idea , but if you want to dont change at your database script , I suggest that for persian Lanaguage using a Dataset for blog enteries(StartDate) , and in your data layer using DataSet group by (http://support.microsoft.com/kb/326145)

I know that , this is not a perfect solution but it will solve this issue.

also we have some UDF that worked correctly by SQL Server 2000 ( I think it's same as Asad provided ) I used it in some of my projects and work wihtout any problem on SQL 2000.

Thanks

Mehdi Alidoost

9/8/2008 6:46:08 AM
Gravatar
Total Posts 18439

Re: Event Calander

Hi Mehdi, Hi Asad,

I will look into integrating the SQL modifications as soon as I get a chance. I think it would not be good performance to do this using a dataset compared to doing it in SQL. If the blog has thousands of posts we would be retrieving all of them in the dataset just to count them using the right grouping and this will not scale very well.

I'll post again to let you know after I have integrated it.

Best,

Joe

9/8/2008 7:10:54 AM
Gravatar
Total Posts 104

Re: Event Calander

That's right.

I offer this becuase I think you perrefer to solve problem wihtout changes on DB side.

Also becuase just we have to retrieve one column (StartDate) in many cases ( if we can't change on DB side) this solution will considerable.

another issue , in Calander can we change the Start day in a week? in Persian Calander Saturday is the first day of week , is there any setting that we can set for this?

Best regards

Mehdi

9/8/2008 7:40:18 AM
Gravatar
Total Posts 18439

Re: Event Calander

Yes I agree selecting only the date column into the dataset would help but still if its thousands of rows or more its not going to be a good solution. Even though that solution would have the benefit of working for all databases, I think on balance given the pros and cons we should solve this in the db. It will only be solved for MS SQL but that is the most popular db in use with mojoPortal.

Asad, I looked at the files you sent me a while back and they are very old patch files, it will be difficult to get what I need from them. Can you just generate the sql script with the UDF(s) and StoredProcedure(s) and send it to me as a .zip? When you generate the script in SQL 2005 Tasks > Generate Scripts, please choose the option for SQL 2000 compatibility.

Thanks,

Joe

9/8/2008 1:53:10 PM
Gravatar
Total Posts 550

Re: Event Calander

Hi Joe

I generate the sql script with the UDF(s) and StoredProcedure(s) and send it to you  as soon as posible until end  of this week.I decide to complete problem and send it as a patch and a zip file of SQL scripts.

best,

Asad.

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