You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
File component calls undefined format_file_size() when rendering its hint #19
<x-forms::file> (and the components extending File) crash when they render their default hint, unless the app happens to define a global format_file_size():
Error: Call to undefined function Javaabu\Forms\Views\Components\format_file_size()
at src/Views/Components/File.php:117 (File::getHint())
format_file_size() isn't defined by javaabu/forms or by javaabu/helpers ^1.74 (only by apps that copied it from the old skeleton). Reproduce in a plain Testbench app:
Needed: format the size inside the package (e.g. Illuminate\Support\Number::fileSize($this->maxSize * 1024), max size being in KB), or ship the helper. A test rendering <x-forms::file> with its hint would catch it.
Found by: javaabu/imports v2 (n4ff4h/imports, next-gen) uses <x-forms::file> for the upload form. Until this is fixed it passes its own help text, which skips getHint(). That's an ordinary attribute, not a workaround, but the default hint can't be used.
Fixed on next-gen by the #18 work (cdc4bae), with a regression test in 3cf84cd; CI green. File::getHint() now uses the package's own Javaabu\Forms\Support\MimeTypes::formatFileSize(), with the KB/MB/GB units from forms::strings. Nothing calls a global format_file_size() any more. The test renders your example (:extensions="['csv', 'xlsx']" :max-size="51200") and checks that the hint reads "Only .csv and .xlsx files of max 50MB allowed.", plus the Dhivehi hint. imports can drop its custom help text.
Fixed on next-gen by the #18 work (cdc4bae), with a regression test in 3cf84cd; CI green. File::getHint() now uses the package's own Javaabu\Forms\Support\MimeTypes::formatFileSize(), with the KB/MB/GB units from forms::strings. Nothing calls a global format_file_size() any more. The test renders your example (:extensions="['csv', 'xlsx']" :max-size="51200") and checks that the hint reads "Only .csv and .xlsx files of max 50MB allowed.", plus the Dhivehi hint. imports can drop its custom help text.
Activity
Test that file inputs render their default hint without format_file_s…
n4ff4h commentedon Nov 4, 2026
Fixed on
next-genby the #18 work (cdc4bae), with a regression test in 3cf84cd; CI green.File::getHint()now uses the package's ownJavaabu\Forms\Support\MimeTypes::formatFileSize(), with the KB/MB/GB units fromforms::strings. Nothing calls a globalformat_file_size()any more. The test renders your example (:extensions="['csv', 'xlsx']" :max-size="51200") and checks that the hint reads "Only .csv and .xlsx files of max 50MB allowed.", plus the Dhivehi hint. imports can drop its customhelptext.n4ff4h commentedon Nov 4, 2026
Fixed on
next-genby the #18 work (cdc4bae), with a regression test in 3cf84cd; CI green.File::getHint()now uses the package's ownJavaabu\Forms\Support\MimeTypes::formatFileSize(), with the KB/MB/GB units fromforms::strings. Nothing calls a globalformat_file_size()any more. The test renders your example (:extensions="['csv', 'xlsx']" :max-size="51200") and checks that the hint reads "Only .csv and .xlsx files of max 50MB allowed.", plus the Dhivehi hint. imports can drop its customhelptext.