Copied to clipboard

Flag this post as spam?

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


  • Christian Tarrild 23 posts 43 karma points
    Apr 07, 2010 @ 09:05
    Christian Tarrild
    0

    "Member can edit" checkbox value is not saved

    Hi

    I am not sure this is the correct forum, but I got no answers in the UI forum.

    I am running Umbraco v 4.0.3 (Assembly version: 1.0.3674.221). When I check the "Member can edit" or "Show on profile" checkboxes and save the membertype the membertype is saved but the tics in the checkboxes are gone. I have tried to manually edit the values in the database table "CMSMEMBERTYPE" but the boxes are not checked eventhough I changed the values from 0 to 1 in the databse. I have reproduced the error in another umbraco installation using umbraco v 4.0.2.1 (Assembly version: 1.0.3441.17657) where also the membership controls package is installed. The problem persists in both Chrome and IE8.

    How do I get umbraco to save the "Member can edit" checkbox values?

    Regards Tarrild

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Apr 07, 2010 @ 10:04
    Dirk De Grave
    0

    Hi Christian,

    Just checked it on a v4021 install and indeed doesn't save the checkbox values! Can you report on Codeplex if not yet reported?

     

    TIA,

    /Dirk

  • Christian Tarrild 23 posts 43 karma points
    Apr 07, 2010 @ 10:49
    Christian Tarrild
    0

    Hi Dirk

    Added an item on Codeplex: http://umbraco.codeplex.com/WorkItem/View.aspx?WorkItemId=26712

    Christian

  • Christian Tarrild 23 posts 43 karma points
    Apr 11, 2010 @ 18:51
    Christian Tarrild
    0

    Hi

    I think i have located the problem. In the MemberType.cs in the umbraco source code i think this:

    public bool MemberCanEdit(propertytype.PropertyType pt) {
       if(propertyTypeRegistered(pt))
    {
         return (SqlHelper.ExecuteScalar<bool>("Select memberCanEdit from cmsMemberType where NodeId = " + this.Id +" And propertytypeId = "+pt.Id));      
       }
       return false;
    }

    Should be changed to

    public bool MemberCanEdit(propertytype.PropertyType pt) {
       if(propertyTypeRegistered(pt))
    {
         return Convert.ToBoolean(SqlHelper.ExecuteScalar<int>("Select memberCanEdit from cmsMemberType where NodeId = " + this.Id +" And propertytypeId = "+pt.Id));      
       }
       return false;
      }

    I am not sure that this is the most correct way to do this, but the problem with the original code is <bool> in the ExecuteScalar since the data is stored as a number.

    How do I pass on this information to the umbraco team?

    Can I change this my self and recompile umbraco?

    /Tarrild

  • Christian Tarrild 23 posts 43 karma points
    Apr 11, 2010 @ 19:02
    Christian Tarrild
    0

    Forgot to add that this only solves the problem that even if the memberCanEdit value is changed directly in the database it would still not be shown correctly in umbraco.

     

    Tarrild

  • Christian Tarrild 23 posts 43 karma points
    Apr 14, 2010 @ 09:59
    Christian Tarrild
    0

    I fixed this bug by downloading the umbraco source code, fixed the buggy code, recompiled Umbraco and uploaded a new version of cms.dll to my bin folder.

    When I compiled Umbraco I got a lot of errors, which I fix solely due to a great forum post on how to fix errors when compiling Umbraco

    Please feel free to download the fixed version of cms.dll, where the memberCanEdit and viewOnProfile are properly saved.

    See also the Issue reported at codeplex.

    /Tarrild

Please Sign in or register to post replies

Write your reply to:

Draft