verbb / navigation

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

Database error when restoring previously-deleted nav #365

Closed elivz closed 12 months ago

elivz commented 1 year ago

Describe the bug

When a project config application restores a previously-deleted navigation, there is an incorrect table name in a query that throws and error and does not restore the previous nodes.

On line 384 of services/Navs.php, I believe

->andWhere(['nodes.deletedWithNav' => true])

should instead be:

->andWhere(['navigation_nodes.deletedWithNav' => true])

That nodes table alias is not present in the query, so the WHERE condition fails currently.

Steps to reproduce

Craft CMS version

4.5.0

Plugin version

2.0.20

Multi-site?

Yes

Additional context

No response

engram-design commented 1 year ago

Absolutely correct! Fixed for the next release. To get this early, run composer require verbb/navigation:"dev-craft-4 as 2.0.20".

engram-design commented 12 months ago

Fixed in 2.0.21