diff --git a/core/lib/Drupal/Core/Extension/module.api.php b/core/lib/Drupal/Core/Extension/module.api.php index b5ff7fe..f4cade9 100644 --- a/core/lib/Drupal/Core/Extension/module.api.php +++ b/core/lib/Drupal/Core/Extension/module.api.php @@ -521,9 +521,9 @@ function hook_install_tasks_alter(&$tasks, $install_state) { * function. Some things to think about: * - Never assume that the database or configuration schema is the same when * the update will run as it is when you wrote the update function. So, - * when saving configuration, use the $trusted_data = TRUE parameter so that - * schema is ignored, and when updating a database table or field, put the - * schema information you want to update to directly into your function + * when saving configuration, use the $has_trusted_data = TRUE parameter so + * that schema is ignored, and when updating a database table or field, put + * the schema information you want to update to directly into your function * instead of calling your hook_schema() function to retrieve it (this is * one case where the right thing to do is copy and paste the code). * - Be careful about API functions and especially CRUD operations that you use @@ -532,6 +532,8 @@ function hook_install_tasks_alter(&$tasks, $install_state) { * normal API functions that invoke all the hooks, use the database schema, * and/or use services in an update function -- you may need to switch to * using a more direct method (database query, etc.). + * - In particular, loading, saving, or performing any other CRUD operation on + * an entity is never safe to do (they always involve hooks and services). * - Never rebuild the router during an update function. * * The following actions are examples of things that are safe to do during @@ -539,7 +541,7 @@ function hook_install_tasks_alter(&$tasks, $install_state) { * - Cache invalidation. * - Using \Drupal::configFactory()->getEditable() and \Drupal::config(), as * long as you make sure that your update data matches the schema, and you - * use the $trusted_data argument in the save operatoin. + * use the $has_trusted_data argument in the save operation. * - Marking a container for rebuild. * * See https://www.drupal.org/node/2535316 for more on writing update functions.