Incompatibility with Views Exposed Filters when "Replace default select field option with its label." is selected

Created on 2 May 2019, over 5 years ago
Updated 18 August 2023, over 1 year ago

It appears that select elements won't always have a ['#title'] property, at least in the case of views exposed filters, I'm getting the following error when using float labels with "Replace default select field option with its label." selected:

The website encountered an unexpected error. Please try again later.
Error: Call to a member function getUntranslatedString() on null in float_labels_select() (line 80 of modules/contrib/float_labels/float_labels.module).

The attached patch mitigates this issue, and when combined with Better Exposed Filters you can change "- all -" to be whatever you want the first select option to be allowing nice control over the select. Otherwise, I don't think this is a great fix, but I'm not sure if #title will be missing anywhere else.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States vood002

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024