verbb / navigation

A Craft CMS plugin to create navigation menus for your site.
Other
90 stars 23 forks source link

Using bypassProjectConfig => true makes navigations un-deleteable #311

Closed vebjorn closed 2 years ago

vebjorn commented 2 years ago

Describe the bug

Navigations won't let themselves be properly deleted as long as "bypassProjectConfig" is set to true. The entry in the database-table for navs never gets the dateDeleted set

Steps to reproduce

  1. Set bypassProjectConfig to true in config/navigation.php
  2. Create a navigation
  3. Delete a navigation
  4. The table-entry for said navigation in "navigation_navs" never gets the dateDeleted attribute set, so said navigation just pops up in the adminpanel again on a page-refresh.

Craft CMS version

4.2.3

Plugin version

2.0.4

Multi-site?

NO

Additional context

This happens both in dev and production, so allowAdminChanges doesn't seem to be in the picture.

vebjorn commented 2 years ago

When looking at the code it might look like the delete-process relies on Project Config, as that is where the event-listeners lie, and doesn't account for the bypassProjectConfig setting at all.

I might be wrong, but it looks like that to me

engram-design commented 2 years ago

Should be fixed for the next release. To get the fix early, change your verbb/navigation requirement in composer.json to:

"require": {
  "verbb/navigation": "dev-craft-4 as 2.0.5",
  "...": "..."
}

Then run composer update.

engram-design commented 2 years ago

Fixed in 2.0.6