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

LENS "select all" ignores search on Action #6140

Closed
komisia opened this issue Jan 9, 2024 · 1 comment
Closed

LENS "select all" ignores search on Action #6140

komisia opened this issue Jan 9, 2024 · 1 comment
Labels
bug Verified bug by the Nova team fix incoming A fix is in review

Comments

@komisia
Copy link

komisia commented Jan 9, 2024

  • Laravel Version: 10.39.0
  • Nova Version: 4.32.11
  • PHP Version: 8.2.11

Description:

When performing a search within a Lens and subsequently selecting "all" search results to execute an Action, the Action incorrectly applies to all records in the Lens rather than just the selected ones.

Steps to Reproduce:

  1. Assume there are 100 records in the Lens.
  2. Conduct a search by a specific name, which yields 5 results.
  3. Click "Select all (5)" for these search results.
  4. Execute an Action on these selected records.

Expected Behavior:
The Action should only affect these 5 models that were selected.

Current Behavior:
The Action impacts all 100 models in the Lens.

Code to reproduce the issue on a fresh Nova installation:

Lense query:

public static function query(LensRequest $request, $query)
    {
        return $request->withOrdering($request->withFilters(
            $query
                ->where('status_id', 4)
        ));
    }

Lense action:

    public function actions(NovaRequest $request)
    {
        return [new Actions\ToCourier];
    }

Action handle:

    public function handle(ActionFields $fields, Collection $models)
    {
        $ids = $models->pluck('id')->toArray();
        info($ids);
     }
@crynobone crynobone added the pending Issues that are pending triage label Feb 12, 2024
@crynobone crynobone added bug Verified bug by the Nova team fix incoming A fix is in review and removed pending Issues that are pending triage labels Feb 23, 2024
Copy link

github-actions bot commented Mar 3, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Verified bug by the Nova team fix incoming A fix is in review
Projects
None yet
Development

No branches or pull requests

2 participants