Skip to content

Commit

Permalink
Merge pull request #1923 from acquia/ACMS-4431
Browse files Browse the repository at this point in the history
ACMS-4431: Conditional check to handle the googleMapApiKeyForm existence.
  • Loading branch information
vishalkhode1 authored Jan 14, 2025
2 parents 75e2925 + 6942c8e commit eb46b6b
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,14 @@ function acquia_cms_development_install($is_syncing) {
// key.So when user visit the content page of place content type, this
// won't show the modal popup error i.e The Google Map cannot be loaded.
// @see \Drupal\cohesion\Form\GoogleMapApiKeyForm
$form = \Drupal::formBuilder()->getForm('\Drupal\cohesion\Form\GoogleMapApiKeyForm');
$form_state = new FormState();
$values['google_map_api_key'] = $gmaps_key;
$form_state->setValues($values);
\Drupal::classResolver(GoogleMapApiKeyForm::class)->submitForm($form, $form_state);
if (\Drupal::moduleHandler()->moduleExists('cohesion') && class_exists(GoogleMapApiKeyForm::class)) {
$form = \Drupal::formBuilder()->getForm(GoogleMapApiKeyForm::class);
$form_state = new FormState();
$values['google_map_api_key'] = $gmaps_key;
$form_state->setValues($values);
\Drupal::classResolver(GoogleMapApiKeyForm::class)->submitForm($form, $form_state);
}

}

/**
Expand Down

0 comments on commit eb46b6b

Please sign in to comment.