tjodalv
Problem with Import Action - Import job never completes
I am having a problem with ImportAction. I want to use it to import products from CSV file. I am testing it with CSV file that has two rows in total. But when I run the action, job keep executing endlessly over and over, spamming failed_import_rows table. I am not sure why is it doing so. If it fails to import the records is should end the job in the end. I also created custom
App\Jobs\ImportCsv
job class that extends Filament\Actions\Imports\Jobs\ImportCsv
job class and added property public $tries = 1;
but that doesn't work either.
If I inspect jobs table in the database I can see that the number of attempts is ridiculesly high, e.g. 15346. Then I need to stop the worker, remove the job from jobs table and clear the failed_import_rows table.
This is how I resolve records in my importer class:
Other then that I just have a bunch of columns defined on the Importer and using afterSave()
hook to perform product stock update, as I keep stocks in separate table.
In the fail_import_rows table validation_error column is always NULL.9 replies
ImportAction job is failing but there is no error message
I have simple table with dozens of fields. Nothing special. I want to import records with Filament ImportAction.
I am able to select file, then I get to choose to map CSV fields with database fields. After I click import, the job is dispatched, but the problem is that job is never completed.
I see in my terminal window where I am running php artisan queue:work that ImportCsv job is failing:
2024-03-13 19:36:32 Filament\Actions\Imports\Jobs\ImportCsv .............................................................................. RUNNING
2024-03-13 19:36:32 Filament\Actions\Imports\Jobs\ImportCsv ......................................................................... 56.26ms FAIL
And the job is running and failing, running and failing over and over again.
But the job is never added to fail_jobs table. I get import error for every row in the CSV file and my
failed_import_rows
table is filled with thousand of records but for each row validation_error field is set to NULL.
My CSV file is not big it has 65 rows, so that should be 65 records but the job is stuced in a loop. I need to stop laravel queue worker and delete the job from the jobs
table.
This is how I run my queue worker
8 replies
Action inside modal is not working
Hi
I have action that open a modal with custom view. On that view I have another action but when I click on that action nothing happens:
And this is my
/resources/filament/modals/payments-list.blade.php
file:
I am setting record on my $removePaymentAction button inside foreach loop. When I click on that button, spinner show and then disappear and nothing happens. The record doesn't get deleted. Confirmation dialog also is not triggering. Can someone help?12 replies
Remove badge from filter action trigger button if there are no active filters
Hi
I would like to remove badge that shows how many filters are currently active if there are no active filters applied to filament table. What would be the easiest way to do it?
2 replies
How to switch eloquent record context for table action
I have a table action that when clicked open infolist. But I want to change the eloquent record context for that infolist. I've tried with
mountUsing
but with no luck:
If I use form then I can bind different record in mountUsing by calling $form->model($otherModel);
and then $form->fill($otherModel->toArray());
2 replies
ViewAction on resource's table listing page
Hi,
I have a model Estimate that has relationship to other model User. I want from ListEstimate page to have action that will open user info in a modal window (slideover). How to achive that? What I tried so far didn't work:
9 replies
customize creating related model in Select form component when using createOptionForm()
Hi
I have a Select form component that is connected with relationship named 'partner' and I want to enable users to create a partner from Select component by using ->createOptionForm() method. My Partner model has many-to-many relationship to PartnerType model and I want set that relationship when creating new Partner, but I do not want the user is able to select partner type. I want to assign fixed partner type when new partner is created.
What would be the best way to achieve that? I've tried something like this, but Filament said that ComponentAction doesn't have using() method:
5 replies
How to update form field from resource Edit page's method?
I have resource edit form. In one placeholder field I am including my custom Livewire component. My Livewire component dispatches event 'update-stock' and with event it is sending $productId and $stock info. I am listening for that event on my resource edit page and when method is triggered I want to update stock field in the underlying form. But for some reason that stock variable doesn't change.
This is code from my resource edit page:
As you can see I was trying to manipulate field values directly in $data array, but that doesn't work. When form is rendered I still see old stock value in the form.
4 replies
Bind different model to action form
I've created action with form that I am calling from some resource edit page. Model binded to that action form is the model that belongs to the resource from which I am calling that action. What I want is to bind completely different model to that action form that have no relation to underlying model. Any ideas how to do that.
Example what I would like to do:
And that action button is called from PageResource edit page that is why I am creating Filament\Components\Actions\Action. My form in action is in no relation to a underlying Page model, and I want to be bind to Product model.
11 replies