+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / modules built with the module builder doesn`t implement item locking

modules built with the module builder doesn`t implement item locking

8 posts, 0 answered
  1. Laura
    Laura avatar
    311 posts
    Registered:
    25 Feb 2008
    03 Dec 2013
    Link to this post
    Is this anywhere on the radar?  Custom module content items become locked and:
    1) there isn't any indicator show that it is locked
    2) my clients need to contact me to unlock them 

    What permission do I need to grant them to allow them to unlock items? (I read somewhere the "modify permissions" permission?)
  2. Pavel Benov
    Pavel Benov avatar
    341 posts
    Registered:
    14 Mar 2016
    06 Dec 2013
    Link to this post
    Hi Laura,

    Which version of Sitefinity are you currently on? Also can you please elaborate on what do you mean by custom module? Is this a static module or a dynamic one created through Module builder? 

    Regards,
    Pavel Benov
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    06 Dec 2013 in reply to Pavel Benov
    Link to this post
    @Pavel I think MB, title says "modules built with the module builder"
  4. Laura
    Laura avatar
    311 posts
    Registered:
    25 Feb 2008
    06 Dec 2013
    Link to this post
    Yes, custom modules.  Actually i copied that from a post here:
    http://www.sitefinity.com/developer-network/forums/general-discussions-/the-content-item-has-already-been-checked-out-by-another-user-and-you-cannot-unlock-it

    That states:
    "The icon of the item indicates published because modules built with the module builder doesn`t implement item locking (when the item have been checkout it will appear as locked by some user)."

    I went looking because we have a few sites (6.1, 6.2) that have more than one person updating the items (built with the custom module builder) and they get locked (maybe they used the browser back button and it became locked, not sure) I then get the request to go in and unlock it. It happend a number of times from two different sites yesterday so I went looking in the forums.

    Next time that happens, we will look in the database for any errors we may have caught.
    But in the end, the issues is that the published icon never changes for items built with custom modules.

    Thank you.
  5. Pavel Benov
    Pavel Benov avatar
    341 posts
    Registered:
    14 Mar 2016
    11 Dec 2013
    Link to this post
    Hello Laura,

    Dynamic module items get locked when a user is editing them and they are displaying the proper icon for that as any other content item in Sitefinity - see image. By design a locked item can be unlocked by the admins or by the owner of the item. If you want to unlock the item on demand you can implement the code provided in the referred forum post in a user control, create a backend page and drop it on it so that other users can use it to unlock items.

    Regards,
    Pavel Benov
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Craig
    Craig avatar
    82 posts
    Registered:
    07 Apr 2009
    12 Dec 2013 in reply to Pavel Benov
    Link to this post
    Here is an example of the code I use to fix the locks.  In this case I have products module.  Hopefully you will find this useful.

    public bool FixProduct(string strUrlName)
    {
        try
        {
            DynamicModuleManager dynamicModuleManager = DynamicModuleManager.GetManager();
            Type productType = TypeResolutionService.ResolveType("Telerik.Sitefinity.DynamicTypes.Model.Products.Product");
            DynamicContent productItem = dynamicModuleManager.GetDataItems(productType).Where(p => p.UrlName == strUrlName && p.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Master).FirstOrDefault();
            DynamicContent checkedOutProductItem = dynamicModuleManager.Lifecycle.CheckOut(productItem) as DynamicContent;
             
            ILifecycleDataItem checkInProductItem = dynamicModuleManager.Lifecycle.CheckIn(checkedOutProductItem);
     
            dynamicModuleManager.Lifecycle.Publish(checkInProductItem);
            dynamicModuleManager.SaveChanges();
     
            return true;
        }
        catch (Exception e)
        {
            return false;
        }
    }


    Enjoy!
    Craig
  7. Laura
    Laura avatar
    311 posts
    Registered:
    25 Feb 2008
    13 Jun 2014 in reply to Pavel Benov
    Link to this post

    Pavel,

    What version was this introduced?  It is working in our newer versions but not in 6.1.4300.0.  I am wondering if it is an error on our end or if it is a Sitefinity version issue where the custom module items are not showing the locked icon when locked.

     Thank you.

    UPDATE: I beleive this was fixed with SF 6.2.x ...? 
  8. Pavel Benov
    Pavel Benov avatar
    341 posts
    Registered:
    14 Mar 2016
    18 Jun 2014
    Link to this post
    Hello Laura,

    Yes it was the 6.2 4900 release. Please take a look at the release notes for this version:

    http://www.sitefinity.com/developer-network/forums/general-discussions-/sitefinity-6-2-released#Hk0IgME3622pWP8AAERlJg

    Regards,
    Pavel Benov
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
8 posts, 0 answered