User tests: Successful: Unsuccessful:
Allow to use a custom filter with subform field.
The same as #27561 but for Joomla 4.0
Apply patch, create a subform field , somwhere in CustomHTML module, with custom filter:
<field name="test_fields" type="subform" label="test_fields"
filter="FooBar::filterTest" multiple="true" min="1">
<form>
<field name="test_field" type="text" label="TESTFIELD1"/>
</form>
</field>
Add custom filter class, somwhere in bottom of plugins/system/debug/debug.php
:
class FooBar
{
static function filterTest($value)
{
JFactory::getApplication()
->enqueueMessage('Filter works: ' . json_encode($value));
return $value;
}
}
Then create a Custom module in backed, and try save it.
Look for the message you got
You should get 2 message:
Filter works: {"test_fields0":{"test_field":""}}
and
Module saved
You get 1 message
Module saved
that means the custom filter was ignored
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-03-14 11:07:20 |
Closed_By | ⇒ | wilsonge | |
Labels |
Added:
?
|
Closing as this is ported to j4 in #28335