[Bug]: Problem with resource delete button on edit page
What happened?
Hi, if I install/enable the plugin, the delete button a standard Filament resource page takes 2 clicks to work:
- The first click does something - the main edit form shifts up slightly, but that's it. No confirmation box (if the DeleteAction includes it), and it doesn't delete.
- The second click then does the normal delete action including confirmation etc.
How to reproduce the bug
- Install the package
- Enable it for a panel.
Package Version
0.0.5
PHP Version
8.2.14
Laravel Version
10.48.16
Which operating systems does with happen with?
Linux
Notes
Source code for the resource:
<?php
namespace Notifium\FilamentMarketingreminder\Filament\Resources;
use App\Scopes\TenantDataScope;
use Filament\Forms\Components\TextInput;
use Filament\Tables\Columns\CheckboxColumn;
use Filament\Tables\Columns\TextColumn;
use Notifium\FilamentMarketingreminder\Filament\Resources\ScheduleResource\Pages;
use Notifium\FilamentMarketingreminder\Filament\Resources\ScheduleResource\RelationManagers;
use Notifium\FilamentMarketingreminder\Models\Schedule;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class ScheduleResource extends Resource
{
protected static ?string $model = Schedule::class;
protected static ?string $navigationIcon = 'heroicon-o-calendar-days';
protected static ?string $navigationGroup = 'Reminders Admin';
protected static ?int $navigationSort = 2;
public static function shouldRegisterNavigation() : bool
{
return auth()->user()->isSuperAdmin();
}
public static function form(Form $form) : Form
{
return $form
->schema([
TextInput::make('name'),
TextInput::make('key'),
Forms\Components\Checkbox::make('onetime')->label("Non-Recurring"),
Forms\Components\Checkbox::make('onlaunch')->label("Add on Project Creation"),
]);
}
public static function table(Table $table) : Table
{
return $table
->columns([
TextColumn::make('name'),
TextColumn::make('key'),
CheckboxColumn::make('onetime')->label("One Time Only"),
CheckboxColumn::make('onlaunch')->label("Project Creation")
])
->defaultSort('name')
->filters([
//
])
->actions([
Tables\Actions\EditAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
]);
}
public static function getRelations() : array
{
return [
//
];
}
public static function getPages() : array
{
return [
'index' => Pages\ListSchedules::route('/'),
'create' => Pages\CreateSchedule::route('/create'),
'edit' => Pages\EditSchedule::route('/{record}/edit'),
];
}
public static function getEloquentQuery() : Builder
{
return parent::getEloquentQuery();
}
}
Thanks for reporting, I'll be looking into it!
I can't seem to replicate this problem in the "Filament demo" project. Could you please share your EditSchedule.php? Also, what is the configuration of the active banner?
Hi, I'll try to replicate in a clean repo, but I'm on vacation at the moment so it'll be next week before I can
Andy.
Hi Andy,
No problem, take your time. Enjoy your vacation!
Hi @Jehizkia
I think I found the issue:
- Create a filament resource as normal.
- Create a banner: Location = start of page, Banner Can Be Closed By The User = checked
- Go to the resource page and dismiss the banner
- Edit a resource, and click Delete
- Nothing happens.
- Click Delete again
- The normal filament delete confirmation appears.
I've tested on a clean laravel project, and got the same problem.
Hope that helps, Andy
Hi @ap1969 ,
Thank you very much. I'll be looking into it furthermore 🙏
Same happens also on the resource table when clicking delete button on rows->nothing happens->banner disappear->click delete again->normal filament delete confirmation appears.
Hope there is a fix, Ste