- Issue created by @catch
- Merge request !12332Ensure only enabled links are loaded in SystemMenuBlock. β (Open) created by catch
- π¬π§United Kingdom catch
This is a one-liner apart from the comment changes and performance test update.
While the performance test only shows that the query is updated rather than the improvement itself (the Umami main menu doesn't have any disabled items) that's enough to ensure that this won't regress accidentally.
I think having this many disabled menu links is not very common, but since we already filter the links out when building the tree after manipulators run, there's going to be no functional change for sites.
- π¬π§United Kingdom catch
This breaks workspaces menu integration - e.g. menu links that only exist in a workspace don't get shown in the workspace.
There are two ways to fix that:
1. Add an optional bool argument to ::onlyEnabledLinks() so that the condition can be removed in WorkspacesMenuTreeStorage::loadTree() - essentially undoing the optimisation added here, but only when viewing a workspaces.
2. Bring wse_menu into core, which makes the entire tree storage workspace-enabled.
I'll see if I can get #1 going quickly.
- π¬π§United Kingdom catch
Another way to deal with the workspaces issue would be to only add the ::onlyEnabledLinks() call in SystemMenublock if workspaces isn't enabled, but that would require a ::moduleExists() check, however we could then have a follow-up for workspace-enabled menu trees which would eventually remove that @todo.
- πΊπΈUnited States smustgrave
Appears to be 1 open thread @catch thoughts on mstrelan comment?
- π¬π§United Kingdom catch
Replied on the MR - I think it would be a problem if that was possible, but I don't think it is for the menu block because there's no way alter this.
- πΊπΈUnited States smustgrave
Left 1 small question on the MR. Rest looks good.
- π¬π§United Kingdom catch
I discusssed this with @amateescu in slack and he's not convinced that this is safe to do.
The workspaces code operates on any code that's loading a menu tree, not only the system menu block, so it's removing the condition in cases where it could have been added from elsewhere. Unless we add some kind of explicit alter hook for the system menu block itself, it's not going to be straightforward to target this only at that block.
Moving back to needs work and adding the subsystem maintainer review tag (even if the subsystem is more workspaces than system module.
- π·π΄Romania amateescu
One solution could be for the system menu block to add a "fake" condition to the query (like
system_menu_block = TRUE
), and workspaces could check for that parameter condition before removing the enabled one. - π¬π§United Kingdom catch
#14 should work and would allow other modules to tweak the output of the plugin without completely replacing it.