Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiselect for Actions not working anymore (Uuid Model) #6515

Closed
MBeckers opened this issue Aug 30, 2024 · 1 comment
Closed

Multiselect for Actions not working anymore (Uuid Model) #6515

MBeckers opened this issue Aug 30, 2024 · 1 comment
Labels
needs more info More information is required

Comments

@MBeckers
Copy link

  • Laravel Version: 10.48.20
  • Nova Version: 4.35.0
  • PHP Version: 8.3.10
  • Database Driver & Version: MySQL
  • Operating System and Version: Ubuntu 22.04
  • Browser type and version: Chrome 128.0.6613.85

Description:

With Introduction of Change
Fix ActionRequest inconsistently receiving comma separated string instead of array.
in Laravel Nova 4.35.0

$query = $this->viaRelationship()
            ? $this->modelsViaRelationship()
            : $this->toQueryWithoutScopes()->whereKey(Arr::wrap($this->resources));

Instead of

$query = $this->viaRelationship()
            ? $this->modelsViaRelationship()
            : $this->toQueryWithoutScopes()->whereKey(explode(',', $this->resources));

Will cause to wrap the resources string into an array which will look like

[
     0 => ”firstId,secondId”
]

Thus the Request results in not finding any results and returning "Sorry you are not authorized to perform that action"

It might be only happen for Uuids, i had not the time to dig if this issue occurs also for integer IDs

@crynobone
Copy link
Member

Unable to reproduce the issue, please provide full reproducing repository based on fresh installation as suggested in the bug report template (or you can refer to https://github.com/nova-issues for example)

Also please make sure you running on the latest assets to ensure the frontend send the correct format. If you override any of the frontend (not sure what's "Multiselect for Action" does) then your frontend code need to be updated

@crynobone crynobone added the needs more info More information is required label Sep 2, 2024
@MBeckers MBeckers closed this as completed Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info More information is required
Projects
None yet
Development

No branches or pull requests

2 participants