Sparclex / nova-import-card

A customizable resource import card for laravel nova
MIT License
31 stars 34 forks source link

Relateable rule #5

Closed happyDemon closed 5 years ago

happyDemon commented 6 years ago

There's an issue, if you allow for relations to be set during import.

Laravel\Nova\Rules\Relatable:49 -> $this->query->select('*')->whereKey($value)->first() The query doesn't ever reset, so on the second row being added it will keep adding another primary key check like this: whereid= ? andid= ?.

This makes it fail

Sparclex commented 5 years ago

@happyDemon thanks for your feedback and your pull request. Could you show me your resources and your import for which this issue occurs?

happyDemon commented 5 years ago

@Sparclex It's easy to reproduce, try setting a belongsTo field during import.

Sparclex commented 5 years ago

Thanks its implemented now.