Try our conversational search powered by Generative AI!

Bug? Name in LinkEditorDescriptor for page selector localized

Vote:
 

For the link editor in TinyMCE, when getting the anchor widget, there is a method:

getAnchorWidget = function (widgetList) {
	return array.filter(widgetList, function (wrapper) {
		return "Anchor" == wrapper.name;
	});
}

When I added the same to get the Page widget:

getPageWidget = function (widgetList) {
	return array.filter(widgetList, function (wrapper) {
		return "Page" == wrapper.name;
	});
};

the code doesn't work in languages other than English. Now, I can add || wrapper.name == "Sida" as a workaround for this site, since all the editors use Swedish. However, this appears to be a bug, since when I debug the dojo code, for each widget in widgetList, I get an English name for wrapper.name and a localized name for wrapper.displayName. 

In dotPeek, in LinkEditorDescriptor I do see this part, so I guess that is the reason:

List<HyperLinkModel> list1 = Enumerable.ToList<HyperLinkModel>(Enumerable.Select<IContentRepositoryDescriptor, HyperLinkModel>(Enumerable.Where<IContentRepositoryDescriptor>((IEnumerable<IContentRepositoryDescriptor>) Enumerable.OrderBy<IContentRepositoryDescriptor, int>(ServiceLocator.Current.GetAllInstances<IContentRepositoryDescriptor>(), (Func<IContentRepositoryDescriptor, int>) (r => r.SortOrder)), (Func<IContentRepositoryDescriptor, bool>) (r =>
      {
        if (r.LinkableTypes != null)
          return Enumerable.Count<Type>(r.LinkableTypes) > 0;
        else
          return false;
      })), (Func<IContentRepositoryDescriptor, HyperLinkModel>) (r => new HyperLinkModel()
      {
        Name = r.CustomSelectTitle ?? r.Name,
        Roots = r.Roots,
        WidgetType = "epi-cms.widget.ContentSelector",
        LinkableTypes = r.LinkableTypes
      })));

 

But isn't this a bug, shouldn't DisplayName be  r.CustomSelectTitle ?? r.Name, and 

#85414
Apr 24, 2014 14:28
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.