-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Description
- Laravel Version: 10.21.0
- Nova Version: 4.27.12
- PHP Version: 8.2.0
- Database Driver & Version: mysql-8.0
- Operating System and Version: windows 11
- Browser type and version: chrome 116.0.5845.187
Description:
When using the Textarea field, the value displayed is not using the value provided by displayUsing.
I believe this is because the internal resolveForDisplay is not checking if usesCustomizedDisplay is set and using displayedAs when it is.
Because the value I'm using, it cannot be displayed normally, so an error is thrown and the page cannot be loaded.
Maybe relevant traces:
htmlspecialchars(): Argument #1 ($string) must be of type string, array given {"userId":1,"exception":"[object] (TypeError(code: 0): htmlspecialchars(): Argument #1 ($string) must be of type string, array given at /var/www/html/vendor/laravel/framework/src/Illuminate/Support/helpers.php:124)
[stacktrace]
#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/helpers.php(124): htmlspecialchars(Array, 11, 'UTF-8', true)
#1 /var/www/html/vendor/laravel/nova/src/Fields/Textarea.php(62): e(Array)
#2 /var/www/html/vendor/laravel/nova/src/Fields/FieldCollection.php(120): Laravel\\Nova\\Fields\\Textarea->resolveForDisplay(Object(App\\Models\\Pitches\\Script))
Detailed steps to reproduce the issue on a fresh Nova installation:
- Create a model that has a column of a type not supported by
Textarea(JSON in my case) - Use the
displayUsingfunction to change the display value to something that is supported byTextarea(in my case a string) - Watch the error
htmlspecialchars(): Argument #1 ($string) must be of type string, array given {"userId":1,"exception":"[object] (TypeError(code: 0): htmlspecialchars(): Argument #1 ($string) must be of type string, array given at /var/www/html/vendor/laravel/framework/src/Illuminate/Support/helpers.php:124)appear
Metadata
Metadata
Assignees
Labels
No labels