Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdminMenuNavigationProvidersCoordinator issue in main branch #15246

Closed
Skrypt opened this issue Feb 3, 2024 · 12 comments · Fixed by #15261 or #15320
Closed

AdminMenuNavigationProvidersCoordinator issue in main branch #15246

Skrypt opened this issue Feb 3, 2024 · 12 comments · Fixed by #15261 or #15320
Labels
Milestone

Comments

@Skrypt
Copy link
Contributor

Skrypt commented Feb 3, 2024

I'm getting a lot of these in logs.

2024-02-03 12:39:15.9619|Default|00-4bc7e8b97123fe0446aeb1b4d56c3eee-022055cef940b42d-00||OrchardCore.AdminMenu.Services.AdminMenuNavigationProvidersCoordinator|ERROR|No Builder registered for admin node of type 'AdminNode' 
@Skrypt Skrypt added the bug 🐛 label Feb 3, 2024
@Skrypt Skrypt changed the title AdminMenuNavigationProvidersCoordinator issue in dev branch AdminMenuNavigationProvidersCoordinator issue in main branch Feb 3, 2024
@hishamco
Copy link
Member

hishamco commented Feb 3, 2024

@MikeAlhayek I think you did some changes recently on the navigations APIs

@MikeAlhayek
Copy link
Member

@sebastienros is this our fist issue after merging STJ PR?

@hishamco
Copy link
Member

hishamco commented Feb 4, 2024

How is this related to STJ?

@hishamco
Copy link
Member

hishamco commented Feb 4, 2024

private async Task BuildTreeAsync(Models.AdminMenu tree, NavigationBuilder builder)
{
foreach (MenuItem node in tree.MenuItems)
{
var nodeBuilder = _nodeBuilders.FirstOrDefault(x => x.Name == node.GetType().Name);
if (nodeBuilder != null)
{
await nodeBuilder.BuildNavigationAsync(node, builder, _nodeBuilders);
}
else
{
_logger.LogError("No Builder registered for admin node of type '{TreeNodeName}'", node.GetType().Name);
}
}
}

@MikeAlhayek
Copy link
Member

Because the admin nodes are stored in a document that has to be serialized. I yet had to test it, but you can put a break point in the adminMenuService and see if the nodes mapped to the objects are as expected or not

@MikeAlhayek
Copy link
Member

@Skrypt in your project, do you have a custom implementation of node type? If so, you'll need to register it like this

services.AddAdminNode<CustomAdminNode>();

@Skrypt
Copy link
Contributor Author

Skrypt commented Feb 5, 2024

Nah, I was working either with your ElasticSearch branch or main branch.

@MikeAlhayek
Copy link
Member

Thanks for the feedback. I added a fix to this issue in #15261

@Piedone
Copy link
Member

Piedone commented Feb 12, 2024

This still happens on the latest main (9e66231).

  1. Run fresh setup with the Blog recipe.
  2. Go to /Admin.
  3. 3 such log entries.

@Piedone Piedone reopened this Feb 12, 2024
@MikeAlhayek MikeAlhayek added this to the 1.9 milestone Feb 12, 2024
@MikeAlhayek
Copy link
Member

@sebastienros the last fix seems to only have worked with existing site but not with new sites. I think this is a serialization problem. Can you look at it when you have few mins?

Look at the JSON from a site that was serialized using Newtonsoft

{
    "AdminMenu":[
        {
            "Id":"9dfd2cf25b464a73be65525623c1f65a",
            "Name":"Admin Menu",
            "Enabled":true,
            "MenuItems":[
                {
                    "$type":"OrchardCore.Contents.AdminNodes.ContentTypesAdminNode, OrchardCore.Contents",
                    "ShowAll":false,
                    "ContentTypes":[
                        {
                            "ContentTypeId":"InteractionStory",
                            "IconClass":"fas fa-american-sign-language-interpreting"
                        },
                        {
                            "ContentTypeId":"InteractionStoryCategory",
                            "IconClass":"fas fa-layer-group"
                        },
                        {
                            "ContentTypeId":"InteractionStoryClassification",
                            "IconClass":"fas fa-object-group"
                        }
                    ],
                    "UniqueId":"bcf1141b593a4c3c9bf476b60b5bce3d",
                    "Enabled":true,
                    "Priority":0,
                    "LinkToFirstChild":true,
                    "LocalNav":false,
                    "Items":[
                        
                    ],
                    "Classes":[
                        
                    ]
                }
            ]
        }
    ],
    "Identifier":"4k7pttwzyj53bv73cqey0xqh4y"
}

Here is one that was creating using STJ "new site"

{
    "AdminMenu":[
        {
            "Id":"baef6f85ad13481681cde70ada401333",
            "Name":"Admin menus",
            "Enabled":true,
            "MenuItems":[
                {
                    "UniqueId":"7b293d57056a4eebb3713f07f12c65d8",
                    "Enabled":true,
                    "Priority":0,
                    "LinkToFirstChild":true,
                    "LocalNav":false,
                    "Items":[
                        
                    ],
                    "Classes":[
                        
                    ]
                },
                {
                    "UniqueId":"5118cecfde834dacb26ac08980f1b5a7",
                    "Enabled":true,
                    "Priority":0,
                    "LinkToFirstChild":true,
                    "LocalNav":false,
                    "Items":[
                        
                    ],
                    "Classes":[
                        
                    ]
                },
                {
                    "UniqueId":"3e590d44f8704e4588e272dd966ce291",
                    "Enabled":true,
                    "Priority":0,
                    "LinkToFirstChild":true,
                    "LocalNav":false,
                    "Items":[
                        {
                            "Position":"0",
                            "Priority":0,
                            "LinkToFirstChild":true,
                            "LocalNav":false,
                            "Items":[
                                
                            ],
                            "Classes":[
                                
                            ]
                        },
                        {
                            "Position":"1",
                            "Priority":50,
                            "LinkToFirstChild":true,
                            "LocalNav":false,
                            "Items":[
                                {
                                    "Priority":0,
                                    "LinkToFirstChild":true,
                                    "LocalNav":false,
                                    "Items":[
                                        
                                    ],
                                    "Classes":[
                                        
                                    ]
                                }
                            ],
                            "Classes":[
                                
                            ]
                        }
                    ],
                    "Classes":[
                        
                    ]
                }
            ]
        }
    ],
    "Identifier":"41wx9cfm1011v4947yndbxxjxv"
}

I am guessing one or both of these is invalid?

services.AddJsonDerivedTypeInfo<T, AdminNode>();
services.AddJsonDerivedTypeInfo<T, MenuItem>();

@hyzx86
Copy link
Contributor

hyzx86 commented Mar 14, 2024

Hi @Skrypt , Does your application still have this problem? My application keeps outputting the same log, even if I use the latest preview package

@hyzx86
Copy link
Contributor

hyzx86 commented Mar 14, 2024

Hi @Skrypt , Does your application still have this problem? My application keeps outputting the same log, even if I use the latest preview package

Well, solved , I need to clear out the Redis cache.😒

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants