Categories are placed in a tab without a name?

Vote:
 

http://i.imgur.com/ZQRob1F.png

The standard categories ("icategorizable_category") seem to get placed in an empty tab. What might be causing this? I tried fixing it by creating following class:

    [EditorDescriptorRegistration(TargetType = typeof(CategoryList))]
    public class NewCategoryEditorDescriptor : EditorDescriptor
    {
        public override void ModifyMetadata(EPiServer.Shell.ObjectEditing.ExtendedMetadata metadata, IEnumerable<Attribute> attributes)
        {
            base.ModifyMetadata(metadata, attributes);
            if (metadata.PropertyName == "icategorizable_category")
            {
                metadata.GroupName = SystemTabNames.Content;
            }
        }
    }

But this didn't work either. The groupname property is actually set to "Information" even before i set it manually.

Is this a bug or is it something I've done? The site I'm working on is suppose to become a standard site our company can use when creating future epi sites and I've just started it so there really isn't much code in it yet.

I just upgraded to 7.5.409.0 and I have no memory of this happening before the upgrade.

#79916
Jan 09, 2014 15:03
Vote:
 

Hi Andreas!

What's the value of metadata.GroupName before you change it?

#82890
Mar 21, 2014 8:48
Vote:
 

Hi Linus. As I wrote, the groupname is set to Information even before i set it manually.

We got a solution though, from one of our newly hired consultants which had seen this bug several times before

[InitializableModule]
    [ModuleDependency(typeof (EPiServer.Cms.Shell.InitializableModule))]
    public class SiteMetadataExtenderInitialization : IInitializableModule
    {
        public void Initialize(InitializationEngine context)
        {
            if (context.HostType == HostType.WebApplication)
            {
                var registry = context.Locate.Advanced.GetInstance<MetadataHandlerRegistry>();
                registry.RegisterMetadataHandler(typeof(ContentData), new SiteMetadataExtender());
            }
        }

        public void Uninitialize(InitializationEngine context)
        {
            
        }

        public void Preload(string[] parameters)
        {
        }
    }
    public class SiteMetadataExtender : IMetadataExtender
    {
        public void ModifyMetadata(ExtendedMetadata metadata, IEnumerable<Attribute> attributes)
        {
            foreach (ExtendedMetadata property in metadata.Properties)
            {
                if (property.PropertyName == "icategorizable_category")
                {
                    property.GroupName = Global.CustomTabName.SettingsPanel;
                    property.Order = 1;
                }
            }
        }
    }

    

This places the categories in the area above the usual place where properties are store but it could of course be placed somewhere else aswell. He thought that the bug appears when you use categories as a property on a page at the same time as having the usual categories.

#82972
Edited, Mar 24, 2014 10:03
Vote:
 

Hello Andreas!

I have tried finding the cause of this, but with no success. Partially, it's because I'm not able to reproduce this myself which makes me have to guess about possible causes for this. I tried adding a separate category property, but still works as expected. If it helps, the group name "information" is what is shown as "Content" in the user interface so the data seems alright there. So something must happen in a later stage. The translation that makes "information" become "Content" is part of a system assembly, so I don't think that missing this is the cause of your problem. Do you have any more ideas on how to reproduce this?

#83213
Mar 27, 2014 15:14
Vote:
 

Hi Linus!

I just spoke to Thomas Durrani who helped me solve this bug and he said that he wasn't sure about the cause of it only that he thought it had something to do with using a category property. He mentioned that he had seen some forum entry from before where someone had the same problem and someone from EPiServer had replied and said that this bug would probably be resolved in EPiServer 7.1 but he hadn't followed up on what happen to that forum entry.

I sent my source code to EPiServer support when I asked them for help with this bug so if you are able to get your hands on that then maybe that would help you figure out the cause.

#83218
Mar 27, 2014 15:25
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.