BlogTitleForURL not automatically generated with the same post title

Topics: Enhanced Blog Edition
Oct 3, 2008 at 3:49 PM
Edited Oct 7, 2008 at 3:36 PM
First of all, thanks for the great job!!

I just found this bug.. when the THIRD post with the same title published, the tag  won't show. If you go to "Edit Post", you will see the tag selection is there and "BlogTitleForURL" is empty. If I add "PostTitlename-2", then everything will be fine and tag will show on the posts...

For the SECOND post with the same tile, it worked fine and BlogTitleForURL will be "postTitlename-1".

Interesting enough if I delete my second post, then the third post will take on the name "postTitlename-1" automatically and tag will show...

Where and how BlogTitleForURL was generated? How can I change it?

I have to fix this bug... Please tell me how.... Thanks a lot!!

Oct 10, 2008 at 3:30 PM
This seems be a bug in PostEventReceiver...

Do I need to rebuild the WSP for the entire CKS:EBE? I am afraid that it will overwrite all my changes in the xsl/css codes I've done manually (not through any features)

Can I just add a feature to replace the existing PostEventReceiver? How can I do this?

Thanks a lot!
Oct 13, 2008 at 9:28 PM
Can you give me the fix, I'll add it to the next release?

You should be able to re-build the DLL and add it to the GAC. However, re-deploying the solution should not affect any of your changes (I do it all the time on my blog). As always though, a backup before had would always be a good idea.


Oct 14, 2008 at 2:40 PM
Thank you, Vince!

I am working on it.. Once I finish, I will send you the updates.

Oct 15, 2008 at 2:46 PM
Edited Oct 15, 2008 at 3:54 PM
Hi Vince,

Here is the fix---quite simple actually.

In PostEventReceivers.cs---method  public static void UpdateTitleForUrl(SPListItem item)

                    SPListItem oExisting = UrlProvider.GetPostFromUrlTitle(sNewTitle, item.Web);
                    int count = 1;
                    while (oExisting != null && count < 1000)
                        oExisting = UrlProvider.GetPostFromUrlTitle(sNewTitle + "-" + count.ToString(), item.Web);
                        if (oExisting == null) sNewTitle += "-" + count.ToString();
                        count++; //Added

I've tested it and it worked fine.

I rebuilt the wsp and deployed it---yup all the changes I made manually remained. 
The dll (272K) and wsp (997K) is larger than the downloads from March.(220K and 966K) . Must be addins since March release?

I will work on adding attachment to the post or will it be included in the next release?

Oct 15, 2008 at 3:53 PM

Actually after your post I had a quick look myself and added exaclty the same line of code. So yes it is in the current 2.5 beta release.

Oct 15, 2008 at 3:58 PM

Currently the posts can't attach files. Will the new release include the file attachment for posts?


Oct 15, 2008 at 4:25 PM
Not at the moment, the standard Blog site removes that functionality. It is possible to add it back though.

Oct 13, 2009 at 9:49 AM

I have changed the lines in the PostEventReceivers.cs but still i'm facing the same problem...

please tel me whether i have to change any other thing.

Thanks in Advance