You are here

function cas_attributes_post_update_unserialize_mappings in CAS Attributes 8

Same name and namespace in other branches
  1. 2.x cas_attributes.post_update.php \cas_attributes_post_update_unserialize_mappings()

Don't serialize the mappings.

File

./cas_attributes.post_update.php, line 11
Post update functions for CAS Attributes module.

Code

function cas_attributes_post_update_unserialize_mappings() {
  $config = \Drupal::configFactory()
    ->getEditable('cas_attributes.settings');
  $config
    ->set('field.mappings', array_filter(unserialize($config
    ->get('field.mappings'))))
    ->set('role.mappings', (array) unserialize($config
    ->get('role.mappings')))
    ->save(TRUE);
}