commerce_add_to_cart_link-2.0.0/commerce_add_to_cart_link.install

commerce_add_to_cart_link.install
<?php

/**
 * @file
 * Contains install and update functions for Commerce Add To Cart Link.
 */

/**
 * Set initial values for the new csrf_token settings.
 */
function commerce_add_to_cart_link_update_8101() {
  /** @var \Drupal\user\RoleInterface[] $roles */
  $roles = \Drupal::entityTypeManager()->getStorage('user_role')->loadMultiple();
  \Drupal::configFactory()
    ->getEditable('commerce_add_to_cart_link.settings')
    ->set('csrf_token.roles', array_keys($roles))
    ->save();
}

/**
 * Set initial value for the new redirect_back setting.
 */
function commerce_add_to_cart_link_update_8102() {
  \Drupal::configFactory()
    ->getEditable('commerce_add_to_cart_link.settings')
    ->set('redirect_back', FALSE)
    ->save();
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc