Commit dffb3050 authored by alexpott's avatar alexpott

Issue #2617590 by aspilicious, Berdir: ConfigEntityBundleBase needs to clear...

Issue #2617590 by aspilicious, Berdir: ConfigEntityBundleBase needs to clear bundle cache when updating a bundle
parent 2eaf108b
......@@ -54,6 +54,7 @@ public function postSave(EntityStorageInterface $storage, $update = TRUE) {
}
// Entity bundle field definitions may depend on bundle settings.
$entity_manager->clearCachedFieldDefinitions();
$entity_manager->clearCachedBundles();
}
}
......
......@@ -10,6 +10,7 @@
use Drupal\field\Entity\FieldConfig;
use Drupal\node\Entity\NodeType;
use Drupal\Core\Url;
use Drupal\node\NodeTypeInterface;
/**
* Ensures that node type functions work correctly.
......@@ -124,6 +125,17 @@ function testNodeTypeEditing() {
$this->assertRaw('Foo', 'Title field was found.');
$this->assertRaw('Body', 'Body field was found.');
// Change the name through the API
/** @var NodeTypeInterface $node_type */
$node_type = NodeType::load('page');
$node_type->set('name', 'NewBar');
$node_type->save();
/** @var \Drupal\Core\Entity\EntityTypeBundleInfoInterface $bundle_info */
$bundle_info = \Drupal::service('entity_type.bundle.info');
$node_bundles = $bundle_info->getBundleInfo('node');
$this->assertEqual($node_bundles['page']['label'], 'NewBar', 'Node type bundle cache is updated');
// Remove the body field.
$this->drupalPostForm('admin/structure/types/manage/page/fields/node.page.body/delete', array(), t('Delete'));
// Resave the settings for this type.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment