Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Steve George 9 posts 29 karma points
    Jan 15, 2010 @ 02:46
    Steve George
    0

    Comments not saving

    Hi,

    This looks like a really useful package that will fit in great with our site unfortunately I'm having a problem. I've set everything up as per the instructions and the comment form displays fine on the pages. However no comments are being saved and the only message I'm getting is "Your comment could not be posted, we're very sorry for the inconvenience.

    I'm running Umbraco 4.0.3 on Windows Server 2003, ASP.Net 2.0, SQL Server 2008.

    As I say the only message I get is the one above. Sorry I can't give any more details.

    Thanks,

    Steve

     

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jan 15, 2010 @ 09:42
    Tim Geyssens
    0

    Hi Steve,

    Could you check your db if the Comment table has been created ?

    If not you can find the create statement here http://ucomment.codeplex.com/SourceControl/changeset/view/36931#585948

  • Steve George 9 posts 29 karma points
    Jan 15, 2010 @ 10:26
    Steve George
    0

    Hi Tim,

    Yes I can confirm the database table is there. I did trying dropping it and recreating from your SQL but I'm still getting the same message.

    Steve

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jan 15, 2010 @ 10:40
    Tim Geyssens
    0

    Can you check your /config/restExtensions.config file to see if it has the Ucomment stuff in there

  • Steve George 9 posts 29 karma points
    Jan 15, 2010 @ 11:39
    Steve George
    0

    I have the following in the file:

      <ext assembly="/bin/UComment" type="UComment.Library.Base" alias="UComment">
        <permission method="CreateComment" returnXml="false" allowAll="true" />
        <permission method="GetGravatarImage" returnXml="false" allowAll="true" />
      </ext>

    Thanks,

     

    Steve

     

  • Steve George 9 posts 29 karma points
    Jan 15, 2010 @ 12:38
    Steve George
    0

    Tim,

    I don't know if this will help at all but I've done a little more digging on the forum and there is a similar error reported in this thread - http://our.umbraco.org/forum/developers/extending-umbraco/6095-Blog4Umbraco-Gravatar-problem?p=0#comment22069

    Steve

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jan 15, 2010 @ 13:32
    Tim Geyssens
    0

    Steve,

    Can you try a couple of test email addresses ?

  • Steve George 9 posts 29 karma points
    Jan 15, 2010 @ 14:13
    Steve George
    0

    Tim,

    Aha! It looks like it is an issue with the email address. If I enter "webmaster@gwsr,com" the comment is saved fine but if I use my own address which is a ".co.uk" one I get the error.

    Steve

  • Sebastiaan Janssen 4899 posts 14655 karma points MVP admin hq
    Jan 15, 2010 @ 15:02
    Sebastiaan Janssen
    0

    Yes, the regex for the email address validation should really be updated (see the thread that Steve George linked to).

  • Timsn 121 posts 231 karma points
    Jan 15, 2010 @ 15:12
    Timsn
    0

    Hi, the regex I submitted in the patch should be able to validate addresses with numbers as well as ".co.uk" ones. Take a look and try it. :)

  • Immo Wache 69 posts 224 karma points
    Jan 15, 2010 @ 15:20
    Immo Wache
    0

    Yes, email regex in base.cs is the point. For me, I have a dot (.) in the name before (@) and a minus (-) after, both fails.

    Unfortunately this problem affects some more Umbraco areas. At the moment I found:

    • blog4umbraco
    • uComment and
    • Comment function at the umbraco.org blog

    :-(

    Immo

     

     

  • Steve George 9 posts 29 karma points
    Jan 15, 2010 @ 15:49
    Steve George
    0

    Tim,

    Please forgive my ignorance but this is my first time working with someone else's source for an add on. I've downloaded the source for uComment and the patch you referenced. I've replaced the Base.cs file in the project (I couldn't find BlogLibrary.cs which is in the patch in the project).

    When I try and build the project I get the following two errors:

    The type or namespace name 'Spam' does not exist in the namespace 'Umlaut.Umb.Blog' (are you missing an assembly reference?)    C:\Users\Steve\Documents\Visual Studio 2008\Projects\UComment\UComment\Library\Base.cs    15    23    UComment
    The type or namespace name 'Interfaces' does not exist in the namespace 'Umlaut.Umb.Blog' (are you missing an assembly reference?)    C:\Users\Steve\Documents\Visual Studio 2008\Projects\UComment\UComment\Library\Base.cs    17    23    UComment

    Apologies for so many questions.

    Steve

  • Timsn 121 posts 231 karma points
    Jan 15, 2010 @ 16:01
    Timsn
    1

    The patch I've uploaded is for the blog4umbraco package. This is where I noticed the bug first and so I submited a patch for it. So you can't simply replace the source file if you're using UComment. I should have mentioned that.

    But it's very easy to replace the regex in UComment as well.

    Just search in the Base.cs for:

            private static bool isValidEmail(string email) 
    {
    Regex r = new Regex(@"^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$");

    if(!string.IsNullOrEmpty(email))
    return r.IsMatch(email);
    else
    return false;
    }

    and replace it with this:

            private static bool isValidEmail(string email) 
    {
    Regex r = new Regex(@"^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$");

    string mailToCheck = email.ToLower();

    if(!string.IsNullOrEmpty(mailToCheck))
    return r.IsMatch(mailToCheck);
    else
    return false;
    }

    my change to the BlogLibrary.cs is not relevant for the email validation. This was a change I made for better gravatar support.

  • Timsn 121 posts 231 karma points
    Jan 15, 2010 @ 16:20
    Timsn
    1

    I see that the ToLower() call isn't necessary here.

    So you can simplify it to this:

    private static bool isValidEmail(string email) 
    {
    Regex r = new Regex(@"^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$");

    if(!string.IsNullOrEmpty(email))
    return r.IsMatch(email);
    else
    return false;
    }

    both of them should work :)

  • Steve George 9 posts 29 karma points
    Jan 15, 2010 @ 16:42
    Steve George
    0

    Tim,

    Thanks for your help and patience! It's working now.

    Steve

  • Warren Buckley 2089 posts 4578 karma points MVP ∞ admin hq c-trib
    Jan 21, 2010 @ 09:43
    Warren Buckley
    0

    Has this been updated in the UComment package at all, as I don't think many users would want to download the source to make this change to get a new compilied DLL.

    Warren :)

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jan 21, 2010 @ 11:01
    Tim Geyssens
    2

    Will try to get this updated tomorrow.

  • Warren Buckley 2089 posts 4578 karma points MVP ∞ admin hq c-trib
    Jan 21, 2010 @ 11:18
    Warren Buckley
    0

    Thanks Tim, that would be ACE :)

  • Mike 62 posts 274 karma points
    Jan 29, 2010 @ 15:56
    Mike
    0

    Can anyone tell me the process for updating the base.cs and BlogLibrary.cs in Timsn patch (which I've downloaded)?

    I assume that base.cs and BlogLibrary.cs are part of the compiled Umlaut.Umb.Blog.dll

    What's the best way of updating this?

    Thanks.

  • Timsn 121 posts 231 karma points
    Jan 29, 2010 @ 16:55
    Timsn
    0

    Hi Mike,

    you're right, the two cs files are part of the Blog dll. You need visual studio to exchange the files and rebuild the hole thing after that. If you don't have visual studio or if you're not familiar with it you can download the fixed dll I've uploaded. You can find the link in this thread.

    I want to mention that the patch is only for the blog package (and also the fixed dll), not for the UComment package.

  • Mike 62 posts 274 karma points
    Jan 29, 2010 @ 17:54
    Mike
    0

    Hi Tim,

    Many thanks for this. I've downloaded and updated the DLL and recycled the Application Pool and the comments seem to be working great - which is fantastic - so this is hugely appreciated.

    I've noticed one error appearing inside of Umbraco's admin however. When I click on the 'comments' tab in the admin to view comments that have been made I get the following:

    Could not load control '/usercontrols/Blog4Umbraco/CommentModeration.ascx'.
    Error message: System.Web.HttpParseException: The base class includes the field 'UpdatePanel1', but its type (System.Web.UI.UpdatePanel) is not compatible with the type of control (System.Web.UI.UpdatePanel). --->

    Any ideas?

    Many thanks,

    Mike

  • Mike 62 posts 274 karma points
    Jan 29, 2010 @ 17:56
    Mike
    0

    I should say I'm using Blog4Umbraco 2.0.24 on Umbraco 4.0.3.

  • Timsn 121 posts 231 karma points
    Jan 31, 2010 @ 18:50
    Timsn
    0

    Hmm, I have no idea what that causes. I'll try to reproduce that in some way.

  • Douglas Robar 3570 posts 4671 karma points MVP ∞ admin c-trib
    Feb 05, 2010 @ 14:23
    Douglas Robar
    0

    Mike's problem with the UpdatePanel error is almost certainly because the project (Timsn's update at least) is build with vs2008 and .net 3.5, but Mike's server is using .net 2.0 and ajax 1.0 instead.

    Assuming Mike can install .net 3.5 on his server and update the web.config file accordingly the error should go away.

    But if he's on a shared host that doesn't have .net35... what are the options? Can a dll or two be put in the /bin folder as could be done when ajax 1.0 wasn't installed on the server?

    Open to all ideas and suggestions.

    cheers,
    doug.

  • Timsn 121 posts 231 karma points
    Feb 05, 2010 @ 14:52
    Timsn
    0

    Ouch! You're right Douglas. I build it with VS2008 and .NET 3.5. That didn't come to my mind...

    That's the reason why I can't reproduce it, my server is running with 3.5. To solve the problem temporary for Mike, I can try to rebuild it with .net 2.0

  • Timsn 121 posts 231 karma points
    Feb 05, 2010 @ 15:09
    Timsn
    0

    The project itself actually is a .NET 2.0 project. But there is a reference to the System.Web.Extensions.dll which is required for the use of the UpdatePanel. So the UpdatePanel ist only avaiable in .NET 3.5. But maybe your idea to put this dll into the bin folder could to the job.

  • BarneyHall 141 posts 210 karma points
    Mar 09, 2010 @ 22:30
    BarneyHall
    0

    Hi I'm having the same problem but in Blog4Umbraco_2.0.24.zip package (umb v4.0.3).

    I am actually running asp.net 3.5 but I think the problem has something to do with the environment the replacement dll has been recompiled. The original dll works if I revert to it (but obviously loosing the patch that Timsn's made) so that isn't much good.

    Douglas's post made me look in web.config and I found this:

        <compilation defaultLanguage="c#" debug="false" batch="false">
          <assemblies>
            <!-- ASPNETAJAX -->
            <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
            <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          </assemblies>
        </compilation>

    Does this mean anything to anyone? Can anyone help further?

    Sorry if I'm coming over all grumpy b#llcks, just seems like a big run around the houses to get .co.uk email addresses working in the comments :(

    Thanks as ever,
    Barney

  • jaygreasley 416 posts 403 karma points
    Mar 09, 2010 @ 22:42
    jaygreasley
    1

    aha, do you have the correct web.config? you need the .net 3.5 specific one.

    .net 3.5 has the ajax toolkit built in

    hth

    jay

  • BarneyHall 141 posts 210 karma points
    Mar 10, 2010 @ 08:15
    BarneyHall
    0

    That done the trick!

    Many thanks Jay.

  • jaygreasley 416 posts 403 karma points
    Mar 10, 2010 @ 08:18
    jaygreasley
    0

    sweet. got there eventually :-)

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies