composer update

This commit is contained in:
Oliver Davies 2019-01-24 08:00:03 +00:00
parent f6abc3dce2
commit 71dfaca858
1753 changed files with 45274 additions and 14619 deletions

View file

@ -19,6 +19,7 @@ use Drupal\webform\Plugin\WebformHandler\EmailWebformHandler;
use Drupal\webform\WebformInterface;
use Drupal\webform\Plugin\WebformHandler\RemotePostWebformHandler;
use Drupal\webform\Utility\WebformArrayHelper;
use Drupal\webform\Utility\WebformFormHelper;
use Drupal\webform\Utility\WebformOptionsHelper;
use Drupal\webform\Utility\WebformReflectionHelper;
use Drupal\webform\Utility\WebformYaml;
@ -2712,6 +2713,10 @@ function webform_update_8146() {
}
}
/******************************************************************************/
// Webform-8.x-5.0-rc23 - October 20, 2018.
/******************************************************************************/
/**
* Issue #3006468: Hide empty fields on on submission page.
*/
@ -2743,9 +2748,200 @@ function webform_update_8149() {
}
}
/******************************************************************************/
// Webform-8.x-5.0-rc24 - October 22, 2018.
/******************************************************************************/
/**
* Issue #2980032: SUBMISSION BEHAVIORS: Allow edit the previous submission.
*/
function webform_update_8150() {
_webform_update_webform_settings();
}
/******************************************************************************/
// Webform-8.x-5.0-rc25 - November 5, 2018 (No update required).
/******************************************************************************/
/******************************************************************************/
// Webform-8.x-5.0-rc26 - November 5, 2018 (No update required).
/******************************************************************************/
/******************************************************************************/
// Webform-8.x-5.0-rc27 - November 28, 2018.
/******************************************************************************/
/**
* Issue #3013767: Computed twig element is not working on multi-step form.
*/
function webform_update_8151() {
$config_factory = \Drupal::configFactory();
foreach ($config_factory->listAll('webform.webform.') as $webform_config_name) {
$webform_config = $config_factory->getEditable($webform_config_name);
$elements = $webform_config->get('elements');
// Try to decode elements.
try {
$elements = Yaml::decode($elements);
}
catch (\Exception $exception) {
continue;
}
// Make sure elements is an array.
if (!is_array($elements)) {
continue;
}
$has_computed_element = FALSE;
$flattened_elements =& WebformFormHelper::flattenElements($elements);
foreach ($flattened_elements as &$element) {
// Convert #value property to #template property.
// @see \Drupal\webform\Entity\Webform::initElementsRecursive
if (isset($element['#type']) && strpos($element['#type'], 'webform_computed_') === 0) {
$has_computed_element = TRUE;
if (isset($element['#value']) && !isset($element['#template'])) {
$element['#template'] = $element['#value'];
unset($element['#value']);
}
}
}
if ($has_computed_element) {
$webform_config->set('elements', Yaml::encode($elements));
$webform_config->save(TRUE);
}
}
}
/**
* Issue #3014933: Webform paths not being removed when a webform is deleted.
*/
function webform_update_8153() {
// Load all webforms to improve performance.
$webform = Webform::loadMultiple();
$database = \Drupal::database();
$select = $database->select('url_alias', 'u');
$select->fields('u', ['pid', 'source', 'alias', 'langcode']);
$select->condition('source', '/webform/%', 'LIKE');
$result = $select->execute();
while ($record = $result->fetchAssoc()) {
if (preg_match('#^/webform/([^/]+)/(?:drafts|submissions)$#', $record['source'], $match)) {
// Check if the webform still exists.
$webform_id = $match[1];
if (!isset($webform[$webform_id])) {
// Delete the broken URL alias.
$database->delete('url_alias')
->condition('pid', $record['pid'])
->execute();
}
}
}
}
/**
* Issue #3015990: Option not to store the IP address for logged-in users.
*/
function webform_update_8154() {
_webform_update_webform_settings();
}
/******************************************************************************/
// Webform-8.x-5.0-rc28 - TBD.
/******************************************************************************/
/**
* Issue #3017679: 2 different validation range modes for date/time field.
*/
function webform_update_8155() {
$config_factory = \Drupal::configFactory();
foreach ($config_factory->listAll('webform.webform.') as $webform_config_name) {
$webform_config = $config_factory->getEditable($webform_config_name);
$elements = $webform_config->get('elements');
// Try to decode elements.
try {
$elements = Yaml::decode($elements);
}
catch (\Exception $exception) {
continue;
}
// Make sure elements is an array.
if (!is_array($elements)) {
continue;
}
$has_date_element = FALSE;
$flattened_elements =& WebformFormHelper::flattenElements($elements);
foreach ($flattened_elements as &$element) {
// Convert #min/max property to #date_date_(min|max) property.
// @see \Drupal\webform\Entity\Webform::initElementsRecursive
if (isset($element['#type']) && in_array($element['#type'], ['date', 'datetime', 'datelist'])) {
$has_date_element = TRUE;
if (isset($element['#min']) && !isset($element['#date_date_min'])) {
$element['#date_date_min'] = $element['#min'];
unset($element['#min']);
}
if (isset($element['#max']) && !isset($element['#date_date_max'])) {
$element['#date_date_max'] = $element['#max'];
unset($element['#max']);
}
}
}
if ($has_date_element) {
$webform_config->set('elements', Yaml::encode($elements));
$webform_config->save(TRUE);
}
}
}
/**
* Issue #3015180: Add 'webform_submission_log' submodule.
*/
function webform_update_8156() {
$enable = \Drupal::config('webform.settings')->get('settings.default_submission_log');
if (!$enable) {
$query = \Drupal::entityQuery('webform')
->condition('settings.submission_log', TRUE)
->count();
$enable = $query->execute() > 0;
}
if ($enable) {
try {
\Drupal::service('module_installer')->install(['webform_submission_log']);
}
catch (\Drupal\Core\Database\SchemaObjectExistsException $exception) {
// This is actually expected. The table {webform_submission_log} would exist
// from webform submission entity schema.
}
// Because MySQL does not allow default value on blob/text column types and
// we want to add a not null blob column to a table that is likely to have
// existing rows, we are doing it in such a 3-step fashion.
\Drupal::database()->schema()->addField('webform_submission_log', 'variables', [
'type' => 'blob',
'size' => 'big',
'description' => 'Serialized array of variables that match the message string and that is passed into the t() function.',
]);
\Drupal::database()->update('webform_submission_log')->fields([
'variables' => serialize([]),
])->execute();
\Drupal::database()->schema()->changeField('webform_submission_log', 'variables', 'variables', [
'type' => 'blob',
'not null' => TRUE,
'size' => 'big',
'description' => 'Serialized array of variables that match the message string and that is passed into the t() function.',
]);
}
}
/**
* Issue #3022398: Possible modification to update hook and/or documentation.
*/
function webform_update_8157() {
_webform_update_webform_submission_storage_schema();
}