Problem/Motivation
The Google CSE search can fail to work when very few JS files are loaded for anonymous users, because the drupal.js file is never loaded on the page and the JS console reports "Undefined variable Drupal".
Steps to reproduce
...
Proposed resolution
Add the full set of dependencies to google_cse.libraries.yml
The libraries are currently specified as:
googlecseResults:
css:
theme:
css/google_cse.css: {}
js:
js/google_cse_results.js: {}
dependencies:
- core/drupalSettings
But the following also need to be added as dpenedencies, since they are also used in the google_cse.js file:
- core/jquery
- core/drupal
Issue fork google_cse-3210785
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
lreynaga commentedThanks for reporting this and creating the MR.
I've never encountered this before given we probably load these libraries somewhere prior, but as you've mentioned, it makes sense to have these dependencies specified within the libraries file.
Comment #5
lreynaga commented