In #2953656: No ability to control "extra fields" with Layout Builder, the ability to place blocks representing "extra fields" on entities was added. The category that these block plugins appeared in is "Content", which previously matched the category that normal fields were placed in.

I know that there was a recent issue where the normal fields category name was changed from "Content" to "Content fields" (I can't find it). But this change has left the extra field blocks alone in the "Content" category:

layout builder choose block interface

The category for this block should be updated to be "Content fields"

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bkosborne created an issue. See original summary.

bkosborne’s picture

Status: Needs review » Needs work

The last submitted patch, 3: extra-field-block-category-label-3020572.patch, failed testing. View results

bkosborne’s picture

bkosborne’s picture

Status: Needs work » Needs review
tim.plunkett’s picture

Status: Needs review » Needs work
Issue tags: +Blocks-Layouts, +Needs tests

Fix looks good, NW for tests

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

tim.plunkett’s picture

Issue tags: +sprint
mark_fullmer’s picture

Test added -- verifies that an extra field exists within the "Content fields" category.

johnwebdev’s picture

  1. +++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php
    @@ -688,13 +688,28 @@ public function testLayoutBuilderChooseBlocksAlter() {
    +        if ($summary->getText() == "Content fields") {
    

    == => ===
    Use single quotes.

  2. +++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php
    @@ -688,13 +688,28 @@ public function testLayoutBuilderChooseBlocksAlter() {
    +          $this->assertTrue($extra_field !== FALSE, 'Content field contains extra label');
    

    We should omit the message.

+++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php
@@ -688,13 +688,28 @@ public function testLayoutBuilderChooseBlocksAlter() {
+    foreach ($page->findAll('css', 'details.js-layout-builder-category') as $category) {
+        $summary = $category->find('css', 'summary');

Instead of iterating each details element, we could just grab the details element with summary = 'Content fields' by xPath, and assert it contains Extra label.

mark_fullmer’s picture

Good call on making the test more efficient by targeting via xpath, rather than iterating. All suggested changes are addressed here.

tim.plunkett’s picture

Issue tags: -Needs tests

Can you post a version of the patch with just the test changes, to prove they catch the bug? Also include the full patch in the same comment so the testbot doesn't get confused

mark_fullmer’s picture

Status: Needs review » Needs work
tim.plunkett’s picture

+++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php
@@ -688,13 +688,24 @@ public function testLayoutBuilderChooseBlocksAlter() {
+    $this->clickLink('Add Block');

It's Add block now. Let's get another pair of patches. And if you upload the failing one first, the issue will stay at Needs Review instead of marking it back to Needs Work

mark_fullmer’s picture

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me, thanks!

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 63148fa and pushed to 8.8.x. Thanks!

  • catch committed 63148fa on 8.8.x
    Issue #3020572 by mark_fullmer, bkosborne, tim.plunkett: Layout builder...

Status: Fixed » Closed (fixed)

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