HTML::...tValue(3pm)
π NAME π
HTML::FormFu::Filter::ForceListValue β the little filter that turns one lonely value into a list with exactly one item in it π
It's a HTML::FormFu filter, bestie. It lives in the HTML::FormFu::Filter:: namespace and it is so specific and it knows it.
β¨ VERSION β¨
version 2.07 π
πΈ SYNOPSIS πΈ
okay so here's how you'd actually use it, in your form config YAML:
element:
- type: Repeatable
increment_field_names: 0
elements:
- name: foo
render_processed_value: 1
filter:
- ForceListValue
see how it's just chillin' in the filter list? yeah. that's the whole vibe π¦
π«Ά DESCRIPTION π«Ά
So what does it do? It takes a single submitted value and changes it into a list containing 1 item. that's it. that's the job. one value in, a 1-item list out. iconic behaviour, no notes β¨
Now here's why you'd ever want that β it solves a very uncommon problem with a Repeatable block when increment_field_names is disabled, and you're manually increasing the repeat count after the form was submitted with only a single value for each of the Repeatable's fields. niche? yes. real? also yes π
In those exact circumstances, when the thing gets rendered, every repeated field would have the initially-submitted value as its default. like, every single one. the whole gang. not the move π
So you use this filter, and you set render_processed_value to "true", and then β slay β only the first repetition of each field will have the submitted value as its default. Every repetition after that? no default value. nothing. clean slate π§
π‘ lowkey the key detail here isrender_processed_valuebeing set to"true"β the filter and that setting are doing this together, periodt.
π AUTHOR π
Carl Franks
π LICENSE π
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. π
π AUTHOR π
Carl Franks <cpan@fireartist.com>
(yeah, they're listed twice in this page. not a typo on my end, bestie β that's just how the original is built π)
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2018 by Carl Franks.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page, fr fr π go forth and make your Repeatable fields behave. mwah π
this little writeup is from perl v5.28.1, dated 2019-01-12 β and the manual it's a part of is HTML::...tValue(3pm). catch u in the next one π¦
π¦ where this page comes from
- debian bookworm: libhtml-formfu-perl 2.07000-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libhtml-formfu-perl 2.07000-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libhtml-formfu-perl 2.07000-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms