Repository navigation
Editable cell passes null to html_entity_decode() when the field is null (regression of #745) #2164
TrevorSayre
started this conversation in
BUG
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Livewire PowerGrid version
6.11.1
Livewire version
4.4.8
Laravel version
13.43.0
Which PHP version are you using?
PHP 8.4
Which Theme are you using?
Tailwind
Have you published the resource files and customized them? (php artisan vendor:publish)
Yes
What is the problem?
This is the deprecation from #745, which #749 fixed by adding
strval()inresources/views/components/editable.blade.php. The per-framework editable templates added since don't have that cast, so it's back:resources/views/components/frameworks/tailwind/editable.blade.php(alsodaisyui):html_entity_decode(data_get($row, $field), ENT_QUOTES, 'utf-8')forvalueandplaceholderresources/views/components/frameworks/bootstrap5/editable.blade.php, andtailwindonmain:html_entity_decode($row->{$field}, ENT_QUOTES, 'utf-8')When an
editOnClick()field isnullfor a row, every such row logs:We're on PHP 8.5 (the form's list stops at 8.4); the deprecation exists since PHP 8.1, and PHP 9 is expected to make it a
TypeError. We've published and customized some views, but not the editable ones; this is the package's ownframeworks/tailwind/editable.blade.php.Code snippets
A table with one nullable field made editable:
Steps:
LOG_DEPRECATIONS_CHANNEL=stack, or any error handler that recordsE_DEPRECATED).nicknameisnull.frameworks/tailwind/editableview.How do you expect it to work?
A
nullfield renders as an empty editable cell without a deprecation, the same as the sharededitable.blade.phpalready does withstrval()since #749.Suggested fix: cast in the framework templates too, for example
html_entity_decode(strval(data_get($row, $field)), ENT_QUOTES, 'utf-8'). Or pass the$valuethe shared template already computes down to them, so the value is decoded in one place.Workaround until then: return
''instead ofnullfor the field infields().Please confirm (incomplete submissions will not be addressed)
All reactions