Skip to content

Commit

Permalink
Merge pull request #81 from carolpettirossi/issue-80
Browse files Browse the repository at this point in the history
feat: Issue #80: Make field_amenities_icon optional.
  • Loading branch information
podarok authored May 28, 2024
2 parents 93cf1db + 63fe80f commit a6afa54
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ entity_type: taxonomy_term
bundle: amenities
label: Icon
description: 'Icon will be displayed on Amenities page. Find 1 million of free SVG icons at <a target="_blank" href="https://thenounproject.com">thenounproject.com</a>'
required: true
required: false
translatable: false
default_value: { }
default_value_callback: ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,25 @@ function openy_txnm_amenities_update_8001() {
}
}
}

/**
* Set amenities icon as not required.
*/
function openy_txnm_amenities_update_9001()
{
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_txnm_amenities') . '/config/install/';
// Update multiple configurations.
$configs = [
'field.field.taxonomy_term.amenities.field_amenities_icon' => [
'required',
],
];

$config_updater = \Drupal::service('openy_upgrade_tool.param_updater');
foreach ($configs as $config_name => $params) {
$config = $config_dir . $config_name . '.yml';
foreach ($params as $param) {
$config_updater->update($config, $config_name, $param);
}
}
}

0 comments on commit a6afa54

Please sign in to comment.