Mercurial > hg > isophonics-drupal-site
diff core/modules/language/language.post_update.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/language/language.post_update.php Wed Nov 29 16:09:58 2017 +0000 @@ -0,0 +1,28 @@ +<?php + +/** + * @file + * Post update functions for Language module. + */ + +use Drupal\Core\Entity\Entity\EntityFormDisplay; + +/** + * Add the 'include_locked' settings to the 'language_select' widget. + */ +function language_post_update_language_select_widget() { + foreach (EntityFormDisplay::loadMultiple() as $display_form) { + $content = $display_form->get('content'); + $changed = FALSE; + foreach (array_keys($content) as $element) { + if (isset($content[$element]['type']) && $content[$element]['type'] == 'language_select') { + $content[$element]['settings']['include_locked'] = TRUE; + $changed = TRUE; + } + } + if ($changed) { + $display_form->set('content', $content); + $display_form->save(); + } + } +}