modules built with the module builder doesn`t implement item locking
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?)
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
@Pavel I think MB, title says "modules built with the module builder"
Yes, custom modules. Actually i copied that from a post here:
www.sitefinity.com/.../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.
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
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
;
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 ...?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