Comments (8)
I had the same issue.
It's surely related to Core, but since this thread is the first on Google for this issue, I'm reacting here.
Here is how I fixed it for those who are still struggling.
In my case, the issue raised when at least one of the related option was missing the 'name'.
I just filtered my query with 'whereNotNull' as below.
Select::make('organization_id')
->label('Organization')
->options(Organization::whereNotNull('name')->pluck('name', 'id'))
->disabled()
->default(function (RelationManager $livewire) {
return $livewire->ownerRecord->organization_id ?? '';
}),
Hope this helps.
from filament-import.
"The error was caused by a null value as the second parameter in the database, which I forgot to make non-null when writing the code. An empty value was inserted into the database, resulting in an error."
from filament-import.
can you please attach your script?
from filament-import.
@abdulmejidshemsu did you get this sorted out I'm having the same problem
from filament-import.
@EmJay646 the issue was from the excel file I was using, it contained validation, it wasn't plain excel file.
what you can do to solve this is remove all validation from the excel that you are trying to upload or copy and paste the entire content of that excel to another blank excel and upload the new one
from filament-import.
I am encountering the same error when I have a Resource that defines a Forms\Components\Select::make(...)->relationship(..) which is a Relationship pointing to the same class as the Resource class.
My Company has a nullable LinkedCompany but if I add that to the $form->schema([ it fails with the mentioned error.
class CompanyResource extends Resource
{
protected static ?string $model = Company::class;
protected static ?string $label = 'Firma';
protected static ?string $pluralLabel = 'Firmen';
protected static ?string $recordTitleAttribute = 'name';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('name')
->label('Name')
->maxLength(191),
Forms\Components\Select::make('linked_company_id')
->label('Linked Firma')
->relationship('linkedCompany', 'name'),
]);
}
}
from filament-import.
I've just had this same error and came across this issue by chance (I'm not using filament-import so I think this is related to the core).
Can confirm that I'm trying to create a relationship with the same model as the resource that I'm in.
class QuestionsRelationManager extends RelationManager {
protected static string $relationship = 'questions';
// ....
Repeater::make('hide_logics')
->relationship()
->schema([
Select::make('value_question_id')
->label('Related Question')
->relationship('related_question', 'id')
->options(function (RelationManager $livewire) {
return $livewire->ownerRecord->questions()->get()->filter(fn($q) => $q->id != $livewire->id)->pluck('text', 'id');
})
->searchable()
->required(),
Haven't found a solution yet, just thought I'd chime in with a confirmation of the issue.
from filament-import.
I found the issue is that in the options field of select, null is returned. In the above one
return $livewire->ownerRecord->questions()->get()->filter(fn($q) => $q->id != $livewire->id)->pluck('text', 'id');
is returning ['someId' => null ]. so make sure that the text is not null for all reords.
from filament-import.
Related Issues (20)
- Persistent filetype validation error message
- "Could Not Find Zip Member" Error HOT 20
- update for filament 3.x HOT 1
- `auto_detect_line_endings is deprecated` warnings with PHP 8.1 HOT 1
- Import Field Not Detecting in the lastest version HOT 2
- Import failed, please check your import file and try again HOT 5
- handleRecordCreation is not working HOT 1
- pacth correct and there are but system can not read that HOT 5
- 'Konnco\FilamentImport\ImportField' is depreciated HOT 2
- ImportAction for Filament\Tables\Actions\Action HOT 12
- Auto match columns HOT 10
- Doesn't work with date? HOT 1
- It tries to import empty rows HOT 2
- Sync lock and json to update PSR/Simple-Cache dependancy lock HOT 2
- Maximum execution time error HOT 2
- Excel Blank Rows Calls mutateBeforeCreate
- importer does not convert expressions to values HOT 1
- Importing only process one row
- Failed to load resource: the server responded with a status of 401 ()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from filament-import.