Setting filter placeholder value fails

Created on 14 February 2024, 9 months ago
Updated 6 March 2024, 9 months ago

Problem/Motivation

Steps to reproduce

Set 'Empty filter placeholder' in views config

Proposed resolution

Looks to be grabbing the value from the wrong place.

Line 128 of data tables.module

$datatable_options['sFilterColumnsPlaceholder'] = $options['['filter_columns_placeholder'];

Should be changed to

$datatable_options['sFilterColumnsPlaceholder'] = $options['filter_columns']['filter_columns_placeholder'];

Here is the printed array of $options that reference


  Array
(
    [grouping] => Array
        (
        )

....
....
    [filter_columns] => Array
        (
            [filter_columns_placeholder] => Search...
            [name] => thead_input
            [field_stem_occupations_text] => thead_input
        )

    [filter_columns_placeholder] => - Filter -
)

Here you can see we have two different filter_columns_placeholder values and it seems views sets ['filter_columns']['filter_columns_placeholder'] but code is looking at [filter_columns_placeholder] which is still '- Filter -'.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States agn507

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @agn507
  • πŸ‡ΊπŸ‡ΈUnited States agn507

    Also looks like line 206 of DataTables.php also needs an update so views pulls from the correct place.

    '#default_value' => $this->options['filter_columns_placeholder'],

    should be

    '#default_value' => $this->options['filter_columns']['filter_columns_placeholder'],

  • πŸ‡«πŸ‡·France dqd London | N.Y.C | Paris | Hamburg | Berlin
Production build 0.71.5 2024