diff --git a/core/modules/node/src/Form/NodePreviewForm.php b/core/modules/node/src/Form/NodePreviewForm.php index ec48909..e8e7374 100644 --- a/core/modules/node/src/Form/NodePreviewForm.php +++ b/core/modules/node/src/Form/NodePreviewForm.php @@ -87,6 +87,10 @@ public function buildForm(array $form, FormStateInterface $form_state, EntityInt $view_mode_options = $this->entityManager->getViewModeOptionsByBundle('node', $node->bundle()); + // Unset view modes that are not used in the front end. + unset($view_mode_options['rss']); + unset($view_mode_options['search_index']); + $form['uuid'] = array( '#type' => 'value', '#value' => $node->uuid(), diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php index 9163a6d..e712440 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php @@ -94,6 +94,13 @@ class EntityManagerTest extends UnitTestCase { protected $typedDataManager; /** + * The config factory. + * + * @var \Drupal\Core\Config\ConfigFactoryInterface + */ + protected $configFactory; + + /** * {@inheritdoc} */ protected function setUp() { @@ -128,6 +135,8 @@ protected function setUp() { $this->typedDataManager = $this->getMockBuilder('\Drupal\Core\TypedData\TypedDataManager') ->disableOriginalConstructor() ->getMock(); + + $this->configFactory = $this->getConfigFactoryStub(); } /** @@ -158,7 +167,7 @@ protected function setUpEntityManager($definitions = array()) { ->method('getDefinitions') ->will($this->returnValue($definitions)); - $this->entityManager = new TestEntityManager(new \ArrayObject(), $this->moduleHandler, $this->cache, $this->languageManager, $this->translationManager, $this->getClassResolverStub(), $this->typedDataManager); + $this->entityManager = new TestEntityManager(new \ArrayObject(), $this->moduleHandler, $this->cache, $this->languageManager, $this->translationManager, $this->getClassResolverStub(), $this->typedDataManager, $this->configFactory); $this->entityManager->setContainer($this->container); $this->entityManager->setDiscovery($this->discovery); }