-
Notifications
You must be signed in to change notification settings - Fork 36
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
ErrorException Illegal offset type in PerformsValidation for custom fields with array attribute. #2834
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi @mikebronner, you still think we should fix this or your workaround should already be enough. We could make some changes to check whether /**
* Map field attributes to field names.
*
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
* @return Illuminate\Support\Collection
*/
private static function attributeNamesForFields(NovaRequest $request)
{
return (new static(static::newModel()))
->availableFields($request)
->reject(function ($item) {
return empty($item->name);
})
->filter(function ($item) {
return is_string($item->attribute);
})
->mapWithKeys(function ($item) {
return [$item->attribute => $item->name];
});
} |
Well ? do we have a fix for this ? |
Description:
The recent change made here (https://github.com/laravel/nova/commit/eebd0f5e80c22ac813c9e5bc9b462a0a097c23b4#diff-ef2858dddcf5b5ad37d0e8cede02604cR273) is breaking custom fields that return arrays as values.
Value of $item
Stacktrace
Any suggestions on how to deal with this? Thanks!
The text was updated successfully, but these errors were encountered: