Skip to main content

Posts

Showing posts from August, 2017

Automatically create new version for Lock & Edit without workflow

Sitecore will create a new version on Lock and Edit if the item is tied to a workflow. For our case, version has to be created even without using workflow.
As mentioned by Dylan here, we can override the default behavior of Sitecore. Here we overridden the “Checkout” command which is executed on Lock & Edit.
Added a setting called EnableAddVersionWithoutWorkflow as a flag to enable this feature. If it is true, it will add a version and lock the new version for the user.
Note: By default, only a non-admin user will see the lock and edit button for an item. 
if (!item.Locking.IsLocked())             { Log.Audit(this, "Start editing: {0}", newstring[]                 { AuditFormatter.FormatItem(item)                 }); if (Context.User.IsAdministrator)                 {                     item.Locking.Lock();                 } elseif (bool.Parse(Settings.GetSetting("EnableAddVersionWithoutWorkflow", "false")))                 { Error.AssertObject(item, "item&q…

Access denied when attaching new media item.

When a Sitecore non-admin user tries to attach a media item, access denied error appears. 
This is due to incorrect Security settings in Sitecore. 
My Sitecore Version:  8.1 (rev. 160519)

Solution by Kasaku

3272 11:36:34 ERROR Application error.
Exception: System.Web.HttpUnhandledException
Message: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Source: System.Web
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Nested Exceptio…