verbb / cp-nav

Control Panel Nav is a Craft CMS plugin to help manage your Control Panel navigation.
MIT License
130 stars 11 forks source link

After updating to Craft 4, existing plugins don't show sub-nav items at all #105

Closed darylknight closed 1 year ago

darylknight commented 2 years ago

Description Looks like a new section was added in Craft 4:

image

This means that all existing plugins (specifically Freeform for us) do not have any subnav items until you reset the navigation.

Steps to reproduce

  1. Update to Craft 4
  2. Plugin sub-nav items are not available until you reset the navigation

Additional info

engram-design commented 2 years ago

Are you saying you upgraded from Craft 3 to Craft 4? If so, then you'll likely need to reset the navigation, because there were a few architectural changes (this is one of them). We try to take care of it, but it's not 100% foolproof, as it's a bit complex. I'll see if we can handle subnav items better.

Or - are you saying that subnav items aren't appearing anyway, after installing a plugin like Freeform (and you've been on Craft 4 already).

As for the nav items on staging, can you check the cpnav_navigation database table? You should be seeing items in there with different level values.

darylknight commented 2 years ago

I meant that I upgraded from Craft 3 to Craft 4, and afterwards, plugins do not have sub-nav items. If it's expected that we'll need to reset the navigation rather than it getting migrated, that's fine - I just thought I'd point it out in case it wasn't intended.

I deleted my second commend about the staging site - looks like the deployment failed. However, after uninstalling, deploying, reinstalling, deploying, then updating the navigation and deploying again - it looks like the staging server still isn't showing the correct navigation.

Here's the settings on the local site:

image

And here's what's appearing under Freeform on the staging server:

image

And here's the cpnav_navigation table:

image

engram-design commented 2 years ago

So it should be handling subnav items during the migration, so I'll look into it.

The issue could be that the subnav items are out of order in the database, but I don't think that should matter. I'll see if I can replicate it. It looks like they're missing their parentId, probably because they're imported first.

scandella commented 1 year ago

Same issue after upgrading from Craft 3. Resetting the navigation did not resolve the issue. I had to set a value for the "Default Subnav Behavior" to have the submenu working again. So it seems that the "Default Subnav Behavior" have no value after the Craft upgrade.

engram-design commented 1 year ago

Fixed in 4.0.4