Update to Drupal 8.1.1. For more information, see https://www.drupal.org/node/2718713
This commit is contained in:
parent
c0a0d5a94c
commit
9eae24d844
669 changed files with 3873 additions and 1553 deletions
|
|
@ -9,6 +9,8 @@
|
|||
* config_test entity hooks themselves.
|
||||
*/
|
||||
|
||||
use Drupal\config_test\Entity\ConfigTest;
|
||||
|
||||
/**
|
||||
* Implements hook_config_test_load().
|
||||
*/
|
||||
|
|
@ -16,37 +18,69 @@ function config_test_config_test_load() {
|
|||
$GLOBALS['hook_config_test']['load'] = __FUNCTION__;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_ENTITY_TYPE_create() for 'config_test'.
|
||||
*/
|
||||
function config_test_config_test_create(ConfigTest $config_test) {
|
||||
if (\Drupal::state()->get('config_test.prepopulate')) {
|
||||
$config_test->set('foo', 'baz');
|
||||
}
|
||||
_config_test_update_is_syncing_store('create', $config_test);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_config_test_presave().
|
||||
*/
|
||||
function config_test_config_test_presave() {
|
||||
function config_test_config_test_presave(ConfigTest $config_test) {
|
||||
$GLOBALS['hook_config_test']['presave'] = __FUNCTION__;
|
||||
_config_test_update_is_syncing_store('presave', $config_test);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_config_test_insert().
|
||||
*/
|
||||
function config_test_config_test_insert() {
|
||||
function config_test_config_test_insert(ConfigTest $config_test) {
|
||||
$GLOBALS['hook_config_test']['insert'] = __FUNCTION__;
|
||||
_config_test_update_is_syncing_store('insert', $config_test);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_config_test_update().
|
||||
*/
|
||||
function config_test_config_test_update() {
|
||||
function config_test_config_test_update(ConfigTest $config_test) {
|
||||
$GLOBALS['hook_config_test']['update'] = __FUNCTION__;
|
||||
_config_test_update_is_syncing_store('update', $config_test);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_config_test_predelete().
|
||||
*/
|
||||
function config_test_config_test_predelete() {
|
||||
function config_test_config_test_predelete(ConfigTest $config_test) {
|
||||
$GLOBALS['hook_config_test']['predelete'] = __FUNCTION__;
|
||||
_config_test_update_is_syncing_store('predelete', $config_test);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_config_test_delete().
|
||||
*/
|
||||
function config_test_config_test_delete() {
|
||||
function config_test_config_test_delete(ConfigTest $config_test) {
|
||||
$GLOBALS['hook_config_test']['delete'] = __FUNCTION__;
|
||||
_config_test_update_is_syncing_store('delete', $config_test);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function for testing hooks during configuration sync.
|
||||
*
|
||||
* @param string $hook
|
||||
* The fired hook.
|
||||
* @param \Drupal\config_test\Entity\ConfigTest $config_test
|
||||
* The ConfigTest entity.
|
||||
*/
|
||||
function _config_test_update_is_syncing_store($hook, ConfigTest $config_test) {
|
||||
$current_value = \Drupal::state()->get('config_test.store_isSyncing', FALSE);
|
||||
if ($current_value !== FALSE) {
|
||||
$current_value['global_state::' . $hook] = \Drupal::isConfigSyncing();
|
||||
$current_value['entity_state::' . $hook] = $config_test->isSyncing();
|
||||
\Drupal::state()->set('config_test.store_isSyncing', $current_value);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@
|
|||
* Provides Config module hook implementations for testing purposes.
|
||||
*/
|
||||
|
||||
use Drupal\config_test\Entity\ConfigTest;
|
||||
|
||||
require_once dirname(__FILE__) . '/config_test.hooks.inc';
|
||||
|
||||
/**
|
||||
|
|
@ -17,15 +15,6 @@ function config_test_cache_flush() {
|
|||
$GLOBALS['hook_cache_flush'] = __FUNCTION__;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_ENTITY_TYPE_create() for 'config_test'.
|
||||
*/
|
||||
function config_test_config_test_create(ConfigTest $config_test) {
|
||||
if (\Drupal::state()->get('config_test.prepopulate')) {
|
||||
$config_test->set('foo', 'baz');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_entity_type_alter().
|
||||
*/
|
||||
|
|
|
|||
Reference in a new issue