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

With Trashed option in BelongsTo field doesn't works when you have an item selected #6031

Closed
dualklip opened this issue Nov 8, 2023 · 2 comments
Labels
bug Verified bug by the Nova team fix incoming A fix is in review

Comments

@dualklip
Copy link

dualklip commented Nov 8, 2023

  • Laravel Version: 10.30.1
  • Nova Version: 4.29.4
  • PHP Version: 8.2.12
  • Database Driver & Version: MariaDB 11.1.2
  • Operating System and Version: macOs 14.1
  • Browser type and version: Google Chrome 118.0.5993.117

Description:

When you have a resource with a BelongsTo field, and this relationship is with another entity that have soft delete capabilities, the field allows you to filter with or without trashed items.

Screenshot 2023-11-08 at 11 36 43

This feature makes a new request to update the dropdown when you click on it, but that only works when you don't have an item previously selected. If you have an item selected, then the requested is not made.

Screenshot 2023-11-08 at 11 45 39

Detailed steps to reproduce the issue on a fresh Nova installation:

  1. Creates a model with soft delete enabled
$table->uuid('id')->primary();
$table->timestamps();
$table->string('title');
$table->uuid('parent_id')->nullable();
$table->softDeletes();
  1. Define the relationship on the Model
public function parentCategory(): BelongsTo
{
    return $this->belongsTo(Category::class, 'parent_id');
}
  1. Creates the Nova resource with the field
BelongsTo::make('parentCategory', Category::class)->nullable(),
BelongsToWithTrashed480.mov
@davidhemphill davidhemphill added the bug Verified bug by the Nova team label Nov 27, 2023
@andrebreia
Copy link

We're also experiencing this issue. Is there an update on this?

Thanks!

@crynobone crynobone added fix incoming A fix is in review and removed fix incoming A fix is in review labels Feb 19, 2024
Copy link

github-actions bot commented Mar 4, 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 4, 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

4 participants