0
votes

I have Sitecore 6.6 with SIP 3.2 running and want to use Item Buckets (updating to Sitecore 7 doesn't work for us in this case). So I installed (the Module) and got the new menus icons to show in Sitecore. The problem is that when I select an item in the content tree, the Bucket button (to convert an item into a bucket) is always inactive. See the following screenshot:

Bucket Button inactive

Google search didn't help. Any idea what is wrong?

EDIT:

Access Viewer: Access Viewer

Security Editor: Security Editor

2

2 Answers

0
votes

It turned out that the item you want to turn into a bucket MUST be locked (click on Home -> Edit). Then the Bucket button is active. Thanks for your help anyway!

0
votes

There are 3 scenarios when this button will be disabled:

  1. This item already is a bucket
  2. Item is NOT locked
  3. User doesn't have access rights to bucket:makebucket on the chosen item.

From what you wrote and from your screenshot I think it's the 2nd or 3rd scenario in your case. Check whether the item is locked and try to use Access viewer and Security Editor to check/assign proper access rights.


EDIT:

You can always debug this command and see what is the reason why it's disabled.

Create a class in your project called MakeBucket (change My.Assembly.Namespace to your project namespace):

namespace My.Assembly.Namespace
{
    using System.Collections.Specialized;
    using Sitecore.Diagnostics;
    using Sitecore.ItemBucket.Kernel.ItemExtensions.Axes;
    using Sitecore.ItemBucket.Kernel.Kernel.Pipelines;
    using Sitecore.ItemBucket.Kernel.Security;
    using Sitecore.Shell.Framework.Commands;

    internal class MakeBucket : Command
    {
        public override void Execute(CommandContext context)
        {
            Assert.ArgumentNotNull(context, "context");
            var items = context.Items;
            Assert.IsNotNull(items, "Context items list is null");
            Context.ClientPage.Start("uiBucketItems", new BucketArgs(items[0], new NameValueCollection()));
        }

        public override CommandState QueryState(CommandContext context)
        {
            Error.AssertObject(context, "context");

            var item = context.Items[0];
            if (!new BucketSecurityManager(item).IsAllowedToCreateBucket)
            {
                return CommandState.Disabled;
            }

            if (!item.Locking.HasLock())
            {
                return CommandState.Disabled;
            }

            return item.IsBucketItemCheck() ? CommandState.Disabled : CommandState.Enabled;
        }
   }
}

and register it in App_Config/Include/Sitecore.ItemBuckets.config instead of original item:bucket command:

<command name="item:bucket" type="My.Assembly.Namespace.MakeBucket,My.Assembly" />

Attach with debugger and put a breakpoint in QueryState method.