Feature PR-5.3-dev Pending

User tests: Successful: Unsuccessful:

avatar Flowman
Flowman
17 Jul 2025

Pull Request for Issue # .

Summary of Changes

Allow to get the default value of a form field. In some cases if you want to compare the current value to the default value and see if they are different.

Testing Instructions

Create a filter_xxx.xml and add a filter with a default value.

In a list view add code:

$this->filterForm = $model->getFilterForm();
$filters = $this->filterForm->getGroup('filter');
foreach ($filters as $fieldName => $field) {
   $field->class .= $field->value != $field->default ? ' active' : ''; 
}

Actual result BEFORE applying this Pull Request

The class active is not added to the field.

Expected result AFTER applying this Pull Request

The class active is added to the file.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar Flowman Flowman - open - 17 Jul 2025
avatar Flowman Flowman - change - 17 Jul 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 17 Jul 2025
Category Libraries
avatar Fedik
Fedik - comment - 17 Jul 2025

The filter is getting the default at

$output->set($key, $fieldObj->filter($input->get($key, (string) $field['default']), $group, $input));

But maybe a "getter" for this will not hurt.

Please rebase the PR to 6.0, as new feature. And add an info how to test it, current info is not clear.

avatar Flowman Flowman - change - 17 Jul 2025
The description was changed
avatar Flowman Flowman - edited - 17 Jul 2025
avatar Flowman Flowman - change - 17 Jul 2025
Title
Allow form filters to get default field value.
[6.0] Add a getter for the default value of a form field
avatar Flowman Flowman - edited - 17 Jul 2025
avatar Flowman Flowman - change - 17 Jul 2025
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2025-07-17 08:14:33
Closed_By Flowman
Labels Added: Feature PR-5.3-dev
avatar Flowman Flowman - close - 17 Jul 2025

Add a Comment

Login with GitHub to post a comment