Skip to content
Snippets Groups Projects
Commit 7c560a70 authored by Yurii Kopylets's avatar Yurii Kopylets Committed by Eirik Morland
Browse files

Issue #3286350 by Project Update Bot: Automated Drupal 10 compatibility fixes

parent 565a7aba
Branches 8.x-1.x
Tags 8.x-1.3
1 merge request!2Issue #3286350: Automated Drupal 10 compatibility fixes
name: bring_postal_code
name: Bring postal code
type: module
description: Extends an address field with postal code validation
core: 8.x
core_version_requirement: ^8 || ^9
core_version_requirement: ^8.7.7 || ^9 || ^10
package: Commerce
......@@ -15,11 +15,13 @@ use Drupal\bring_postal_code\LookupTools;
*/
function bring_postal_code_form_alter(&$form, FormStateInterface $form_state, $form_id) {
$ids = \Drupal::config('bring_postal_code.settings')->get('form_ids');
/** @var \Drupal\bring_postal_code\LookupTools $lookupTools */
$lookupTools = \Drupal::service('bring_postal_code.lookuptools');
foreach (preg_split("/\r\n|\n|\r/", $ids) as $id) {
if ($id == $form_id) {
$lookupTools->attach($form);
if (is_string($ids)) {
/** @var \Drupal\bring_postal_code\LookupTools $lookupTools */
$lookupTools = \Drupal::service('bring_postal_code.lookuptools');
foreach (preg_split("/\r\n|\n|\r/", $ids) as $id) {
if ($id == $form_id) {
$lookupTools->attach($form);
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment