Bug in cse_adjustments.js — input placeholder
complete
Mark Byart
There's a bug in the cse_adjustments.js file, related to the placeholder attribute for Google CSE. It seems to be a widespread bug as it’s occurring on a lot of UMN sites.
It happens when the placeholder attribute isn't set for the search box in configuration > search and metadata > UMN search settings. The lines causing the errors are:
const placeholder = drupalSettings.umn_search.placeholder_text;
input.placeholder = placeholder.length ? placeholder : '';
Placeholder returns null if there is no attribute set, so length() will not work as a test, and returns the error “Cannot read properties of null (reading 'length')”
Dimitri Tadege
marked this post as
complete
Dimitri Tadege
marked this post as
in progress
Dimitri Tadege
marked this post as
planned
Dimitri Tadege
marked this post as
under review