diff -u b/core/lib/Drupal/Core/Config/ConfigImporter.php b/core/lib/Drupal/Core/Config/ConfigImporter.php --- b/core/lib/Drupal/Core/Config/ConfigImporter.php +++ b/core/lib/Drupal/Core/Config/ConfigImporter.php @@ -274,7 +274,7 @@ * Sets a change as processed. * * @param string $op - * The change operation performed, either delete, create or update. + * The change operation performed, either delete, create, rename or update. * @param string $name * The name of the configuration processed. */ @@ -287,7 +287,7 @@ * * @param string $op * The change operation to get the unprocessed list for, either delete, - * create or update. + * create, rename or update. * * @return array * An array of configuration names. @@ -452,8 +452,6 @@ // First pass deleted, then new, and lastly changed configuration, in order // to handle dependencies correctly. - // @todo Implement proper dependency ordering using - // https://drupal.org/node/2080823 foreach (array('delete', 'create', 'rename', 'update') as $op) { foreach ($this->getUnprocessedConfiguration($op) as $name) { if ($this->checkOp($op, $name)) { @@ -600,7 +598,11 @@ $new_name = $names[1]; $target_exists = $this->storageComparer->getTargetStorage()->exists($new_name); if ($target_exists) { - // Change the operation into an update. + // The rename has already occurred as the result of a secondary + // configuration write. Change the operation into an update. This is the + // desired since renames often have to occur together. For example, + // renaming a node type has to rename field instances and entity + // displays. $this->storageComparer->moveRenameToUpdate($name); return FALSE; } @@ -681,7 +683,7 @@ * * @param string $op * The change operation to get the unprocessed list for, either delete, - * create or update. + * create, rename or update. * @param string $name * The name of the configuration to process. * @@ -694,7 +696,7 @@ * otherwise. */ protected function importInvokeOwner($op, $name) { - // Special case renames because they are hard. + // Renames are handled separately. if ($op == 'rename') { return $this->importInvokeRename($name); } diff -u b/core/lib/Drupal/Core/Config/StorageComparer.php b/core/lib/Drupal/Core/Config/StorageComparer.php --- b/core/lib/Drupal/Core/Config/StorageComparer.php +++ b/core/lib/Drupal/Core/Config/StorageComparer.php @@ -118,7 +118,7 @@ * Adds changes to the changelist. * * @param string $op - * The change operation performed. Either delete, create or update. + * The change operation performed. Either delete, create, rename or update. * @param array $changes * Array of changes to add to the changelist. * @param array $sort_order @@ -215,8 +215,7 @@ * * The list of renames is created from the different source and target names * with same uuid, these changes will be removed from the create and delete - * lists. For example, renamed content types should be not removed, but - * updated with the related nodes. + * lists. */ protected function addChangelistRename() { // Renames will be present in both create and delete lists. @@ -253,10 +252,12 @@ } /** - * Removes changes from all lists for the given name. + * Removes the entry from the given operation changelist for the given name. * * @param string $op + * The changelist to act on. Either delete, create, rename or update. * @param string $name + * The name of the configuration to remove. */ protected function removeFromChangelist($op, $name) { $key = array_search($name, $this->changelist[$op]);