verbb / navigation

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

NodeTypeElements/"Linked to Entry" field in node flyout doesn't respect the source restrictions #352

Closed marcusgaius closed 1 year ago

marcusgaius commented 1 year ago

Describe the bug

When I select the node Edit button, I get the edit flyout form. In that form, it's possible to unassign the element that has been originally attached, and the element select button appears. The modal that opens after the button is pressed doesn't follow the restrictions of source selection that is configured for the Nav model.

After looking into the code, I have seen that the sources are indeed marked as a hard-coded '*', even though the relevant verbb\navigation\elements\Node and it's parent verbb\navigation\models\Nav with the permissions are available in the scope.

I am not sure if this is an intended behavior or an oversight, but it definitely doesn't seem intuitive, as anyone who can modify navs can pick any element they like. :)

Best regards, Marko

Steps to reproduce

  1. Created new Nav, disabled all elements but entries, disabled passive and custom url node types. Only allowed Single entry types.
  2. Add a Node to the Nav.
  3. Select Edit for the Node, the flyout panel appears.
  4. Remove the associated element from the Linked to Entry field.
  5. Click Choose to select the element/entry again. All Sections are available to be picked. All structure and channel sections allow for new entries to be added.

Craft CMS version

4.4.11

Plugin version

2.0.17

Multi-site?

No

Additional context

No response

engram-design commented 1 year ago

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

engram-design commented 1 year ago

Fixed in 2.0.18