I cant change a view mode in any Custom Block.

-Created Custom Block
-Created Custom view mode for this specific Custom Block type
-Tried to change the view mode of this newly created Custom Block and saved, no errors
-Went back to the just updated block and nothings changed

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

larowlan’s picture

Issue tags: +Needs tests

Sounds like we're missing some tests here

swentel’s picture

Status: Active » Needs review
FileSize
834 bytes

This should fix it - not tests yet, not sure if I can get to it by next week, so someone else can take over freely

marthinal’s picture

I did the patch adding a test view mode and selecting the value to then determine if selected.
The first one is the test and the second test+ patch.

larowlan’s picture

+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockCreationTest.php
@@ -58,6 +70,14 @@ public function testCustomBlockCreation() {
+    $this->drupalGet('admin/structure/block/manage/stark.testblock');

I think these ids have changed now, will re-test - otherwise rtbc

larowlan’s picture

Issue tags: -Needs tests

Status: Needs review » Needs work
Issue tags: +Needs tests

The last submitted patch, custom_block_view_mode-2099417-3.patch, failed testing.

marthinal’s picture

Status: Needs work » Needs review
FileSize
2.94 KB

Patch + test again with id modification

swentel’s picture

Status: Needs review » Needs work
Issue tags: -Needs tests
  1. +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockCreationTest.php
    @@ -46,9 +46,21 @@ protected function setUp() {
    +    // Add a new 'View Mode' and verify if it is seleted as expected.
    

    Typo: 'seleted'

  2. +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockCreationTest.php
    @@ -46,9 +46,21 @@ protected function setUp() {
    +    // Add a new 'View Mode' and verify if it is seleted as expected.
    

    No need to wrap 'View mode' between quotes, just write 'Add a new view mode ...'

  3. +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockCreationTest.php
    @@ -58,6 +70,14 @@ public function testCustomBlockCreation() {
    +    // Change the 'View Mode'.
    

    Same here

lauriii’s picture

Status: Needs work » Needs review
FileSize
2.94 KB

Fixed comments

marthinal’s picture

Fixed #8 point 2.

swentel’s picture

Status: Needs review » Reviewed & tested by the community

Great, thanks!

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.