Debugging shows that Convert.ToDateTime(CheckFieldExists(nodetomap, "__Sort_createDate")) is the problem as SearchResult nodetomap doesnt contain __Sort_createDate at all.
As nodetomap contained createDate I tried using that - but this is not a valid date. I could do some fixing there but maybe it's just a matter of a missing __Sort_createDate in the examine index (which i not absolutly nothing about).
__Sort_creatDate doesnt seem to be used anymore in umbraco 6.03 so createDate is what is stored in the index and is stored: like this: 20130416000000000 instead of 20130-04-16 00:00:00
so in NodeMapper.cs: you need to modify all mappings that use the SearchResult object :
/// There is a bug in umbraco examine, 8/31/2010 is stored as 20130416000000000 instead of 20130-04-16 00:00:00Z. This is causing an error every time one of these nodes shows up in the search results.
Was that the only change necessary? Changing the NodMapper.cs in the nForum source? I'm still getting the issue after this update in Umbraco 6. Any help would be awesome!
I have the same problem in umbraco 6.1.3 and nForum 1.6. After adding first forum category, I've got this "datetime" error.
I have replaced these two DLLs with these in to posts above. I have also self recompiled source. I don't get this error now, but I also can't see any categories.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.FormatException: String was not recognized as a valid DateTime.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[FormatException: String was not recognized as a valid DateTime.]
System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) +10841066
System.Convert.ToDateTime(String value) +83
nForum.BusinessLogic.Models.NodeMapper.MapForumCategory(SearchResult nodetomap) +204
nForum.BusinessLogic.Data.ForumFactory.<ReturnAllCategories>b__8(SearchResult searchResult) +10
System.Linq.WhereSelectEnumerableIterator`2
error first time when i create topic it works and after login again gives error
String was not recognized as a valid DateTime.
Just installed nforum 1.6 in a vanilla Umbraco 4.11.5.
I've published the default forum and added a category. When accessing the forum (website) I get:
String was not recognized as a valid DateTime.
Any clues?
best
Jesper
Hi again,
Debugging shows that Convert.ToDateTime(CheckFieldExists(nodetomap, "__Sort_createDate")) is the problem as SearchResult nodetomap doesnt contain __Sort_createDate at all.
As nodetomap contained createDate I tried using that - but this is not a valid date. I could do some fixing there but maybe it's just a matter of a missing __Sort_createDate in the examine index (which i not absolutly nothing about).
best
Jesper
I have the same issue after creating and publishing category. Have you solved it?
No. I'm not familiar with examine and I think that the problem is something to do with ___sort_createdate
I've just installed nForum not on Umbraco 4.11.5. but on 4.8.1 (as it's said in description) and it works fine.
I have the same problem - works on my local, but not on staging. Umbraco 4.11/ 6.03 and nForum 1.6
I have the same probleme, too. Umbraco 6.0.3 and nForum 1.6.. I have rebuild examine indexes, but problem persists.
Has anyone a solution to fix this?
Sören
Hi Soren,
I ended up having to hack it.. heres my code:
__Sort_creatDate doesnt seem to be used anymore in umbraco 6.03 so createDate is what is stored in the index and is stored: like this: 20130416000000000 instead of 20130-04-16 00:00:00
so in NodeMapper.cs: you need to modify all mappings that use the SearchResult object :
CreatedOn = CheckDateIsValid(nodetomap, "createDate"),
below is my date checker/ changer.
/// <summary>
/// There is a bug in umbraco examine, 8/31/2010 is stored as 20130416000000000 instead of 20130-04-16 00:00:00Z. This is causing an error every time one of these nodes shows up in the search results.
/// lucene is a frickin pain in the arse
/// </summary>
/// <returns></returns>
private DateTime CheckDateIsValid(SearchResult result, string keyName)
{
string dateString;
DateTime dt;
dateString = result.Fields.ContainsKey(keyName) ? result.Fields[keyName] : "";
if (dateString.Length > 8) dateString = dateString.Substring(0, 8);
DateTime.TryParseExact(dateString, "yyyyMMdd", CultureInfo.CurrentCulture, DateTimeStyles.None, out dt);
return dt;
}
I added this to NodeMapper.cs
Thank you very much. But where I can find the NodeMapper.cs file?
Hey Soren,
You will need to grab the source code and recompile the dlls. This is where i got it from:
http://nforum.codeplex.com/SourceControl/changeset/view/ae8f92ddb261#
Thank you very much! You're great!
Sören
I can't get this to work, could anyone post the code the code for the NodeMapper.cs file so I can see where i'm going wrong.
Thanks
Like Hasheem Maloo
said, you need to add that code to the project and rebuild it.
But if u dont wanna do that, i have made the files already:
DOWNLOAD HERE:
http://userhome.org/nForum_date_fix.zip
Note:
This only works for nForum 1.6.
Install:
The only thing you need to do is to paste the 2 dll files into your /bin folder and replace the existing ones.
But maybe its a good idea to take a backup of the 2 dll files before overwriting them...
Cheers, The Brunkage
Was that the only change necessary? Changing the NodMapper.cs in the nForum source? I'm still getting the issue after this update in Umbraco 6. Any help would be awesome!
Hi,
I have the same problem in umbraco 6.1.3 and nForum 1.6. After adding first forum category, I've got this "datetime" error.
I have replaced these two DLLs with these in to posts above. I have also self recompiled source. I don't get this error now, but I also can't see any categories.
Any ideas?
Best regards
Thomas
String was not recognized as a valid DateTime.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.FormatException: String was not recognized as a valid DateTime.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
is working on a reply...