Problem/Motivation

The jquery.once library was apparently removed in Drupal 10.
So Google Places Autocomplete doesn't work as a consequence.

Steps to reproduce

1) Install Drupal 10
2) Install google_place_autocomplete 8.x-2.1
3) Add a Google Places Autocomplete field widget on your text field
4) View your content type type address in text field its not working.

Proposed resolution

I attached a patch that adds the core/once library and keeps the jQuery dependency.
(See https://www.drupal.org/node/3158256)

Remaining tasks

User interface changes

API changes

Data model changes

Comments

Sunil Chaurasiya created an issue. See original summary.

sunil chaurasiya’s picture

Assigned: sunil chaurasiya » Unassigned
Status: Needs work » Needs review
StatusFileSize
new643 bytes
mukhtarm’s picture

StatusFileSize
new470.3 KB

Verified and patch is applying cleanly. Once applied error is gone.
For more about the issue: https://www.drupal.org/project/announce_autosubmit/issues/3366097

odisei’s picture

Any news regarding Drupal 10 version?

odisei’s picture

Just to confirm the patch is applying cleanly on 8.x-2.1, drupal 10.2.0

durum’s picture

Status: Needs review » Reviewed & tested by the community
tregonia’s picture

+1 RTBC
Confirming the patch is still good.

Sidenote. This issue is a 100% blocker to a functioning module, but this patch gets it working again.

tregonia’s picture

While this patch does swap out the once syntax, it does not update the libraries to use the correct once dependency.

google_place_autocomplete:
  js:
    js/google_place_autocomplete.js: { }
  dependencies:
    - core/jquery
    - core/jquery.once
    - core/drupal
    - core/drupalSettings
    - google_place_autocomplete/google_maps.places

should become

google_place_autocomplete:
  js:
    js/google_place_autocomplete.js: { }
  dependencies:
    - core/jquery
    - core/drupal
    - core/once
    - core/drupalSettings
    - google_place_autocomplete/google_maps.places

Sidenote:
This issue is resolved in another way in 3414138

phannphong’s picture

On Drupal 10, we need this patch and the patch from the issue Google Places Autocomplete Not working Drupal 10 hook_field_widget_WIDGET_TYPE_form_alter is deprecated to bring the modules works back.