- Issue created by @igor mashevskyi
-
astonvictor β
committed ad463d32 on 3.0.x
Issue #3502056 - Add new plugin
-
astonvictor β
committed ad463d32 on 3.0.x
Currently, the Form API Validation module does not provide a built-in filter to automatically apply rtrim to input values. This can lead to issues where trailing space in user input is not removed, resulting in unexpected validation failures or inconsistent data storage.
Adding a filter for rtrim would allow developers to automatically trim trailing space from input values, ensuring cleaner and more predictable user input.
Introduce a new filter option for Form API Validation to apply the rtrim function to input values. This filter will:
Automatically remove trailing space from user input when applied.
Be configurable at the form element level, similar to existing filters like trim.
Example usage in a form definition:
php
Copy code
$form['example_textfield'] = [
'#type' => 'textfield',
'#title' => t('Example Field'),
'#filters' => [
'rtrim' => [],
],
];
Implement the rtrim filter functionality in the Form API Validation module.
Add test coverage to validate the behavior of the rtrim filter.
Update the module documentation to include usage details for the rtrim filter.
No user interface changes are required. This enhancement is configuration-driven and does not directly affect the module's UI.
Add a new filter key (rtrim) in the #filters array for Form API fields.
Ensure the rtrim filter is applied during form input processing.
No changes to the data model are required, as this enhancement operates on input processing only.
Active
3.0
Code
Issue #3502056 - Add new plugin