Some custom modules not shown in navigation menu groups

After upgrading from 8.4 to 8.6 or 8.7 some of my custom modules are not shown in the navigation menu group tabs any more.

I have tried to redeploy, but did not help. Some of the modules of the deployed package are shown without issue, others are not.

Comparing the Menu.php files everything seems fine, as well as other metadata and language files. The modules are returned from the server correctly by the php legacy part of the application, but then not used to paint the menu.

Permissions are correct. Trying with the administrator account anyway.

I have traced the problem to a graphql query with operationName: “appMetadata”, where the response returns the groupedTabs arrays for all navigation menu, but for the group where the problem manifests the “modules” array is empty:

{“data”:{“appMetadata”:{“id”:“/api/app-metadata/app”,“_id”:“app”,“navigation”:{“id”:null,“_id”:null,“userID”:null,“tabs”:[“home”,“scheduled-reports”,“security-groups”,“business-hours”,“resource-calendar”,“accounts”,“contacts”,“calendar”,“emails”,“calls”,“meetings”,“tasks”,“notes”,“project”,“project-templates”,“reports”,“knowledge-base”,“knowledge-base-categories”,“email-templates”,“surveys”,“grupo”,“inventario”,“uso-inventario”],“groupedTabs”:[{“name”:“LBL_GROUPTAB5_1696007649”,“labelKey”:“LBL_GROUPTAB5_1696007649”,“modules”:[“project”,“contacts”,“grupo”,“accounts”]},{“name”:“LBL_GROUPTAB3_1646138630”,“labelKey”:“LBL_GROUPTAB3_1646138630”,“modules”:[]}, …

I am guessing this is something related to my custom modules, but I cannot find the problem.
I’d appreciate some help to locate where the problem is originating.

Thanks.

I have checked that as well.
The not shown modules are not hidden in the “Display Modules and Subpanels” menu.
Any more ideas?

I don0t know the answer, but…

Do you have a modes clause somewhere in there?

I see this in the code and some of these metadata definitions are supposed to include a list of modes that are checked to see if the metadata applies. The full list seems to be this:
modes = ['edit', 'detail', 'list', 'create', 'massupdate', 'filter']

Another thing that could be stopping this is ACL’s, meaning, security groups etc.

I think the problem is Repair and Rebuild is broken in SuiteCRM 8. It doesn’t sync the DB with the vardefs.

At least that has been my experience, so custom modules may have an issue.

Yes, I see several “modes” objects related to various metadata elements, but none inside the navigation menu object, but inside other objects of the page’s metadata, like the panels shown in the page or others.

I don’t think permissions are a problem, because I am doing the testing with an administrator account that supposedly has all privileges over the entire application.

The php files that used to generate those menu groups are still working, and they contain the menu tabs contents correctly but seem to be ignored in the current implementation of the client. I guess as a the application is moving to this new graphql system, more and more of the old php code is being ignored. I am more of a php guy, so I am having troubles to trace where the graphql response is generated. Are the values consulted directly from the database?

1 Like

That would certainly explain a lot of things.
Do you have any more specifics on elements that are left out of sync by the repair operation?

If you can open the browser tools, network tab, and provide me the details of the request that goes out to fetch that metadata, I can try teaching you how that is routed and handled in the backend.

Here is the request json:
{
“operationName”: “appMetadata”,
“query”: “query appMetadata($id: ID!) {\n appMetadata(id: $id) {\n id\n _id\n navigation\n userPreferences\n language\n themeImages\n adminMetadata\n globalRecentlyViewed\n minimalModuleMetadata\n __typename\n }\n}”,
“variables”: {
“id”: “/api/app-metadata/contacts”
}
}

Based on a quick search I would suggest having a look at

core/backend/Metadata/Service/AppMetadataProvider.php

and the functions handling groupedTabs

Thanks a lot.
I’ll see if I can find something there.