- 🇺🇸United States smustgrave
This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request → as a guide.
For this issue to move forward next it will need a test case showing the problem.
Thanks.
- Status changed to Needs review
about 2 years ago 11:46am 7 February 2023 - 🇧🇪Belgium herved
Here is a minimal test which should highlight clearly the issue.
Test only patch should fail of course, and the other one includes the pre_render from #5.About #2 and #10: Extra fields are used in many places now. Modules like https://www.drupal.org/project/extra_field → rely on it.
If the render array is NULL or only contains #cache, it is only logical to hide the container div completely. Those empty divs can be really problematic when asserting the emptiness of paragraphs for example. The last submitted patch, 11: empty_extra_field_block-3152281-11-test_only.patch, failed testing. View results →
- Status changed to Needs work
about 2 years ago 7:09pm 7 February 2023 - 🇺🇸United States smustgrave
So tried replicating
On Drupal 10.1 with standard install
Enabled layout builder for Basic page
Added section
Added Moderated Control block
Create a basic page node (published)
The section markup appears with and without the patch
I do not see an empty div for blocks with or without the patchAm I missing a step?
- 🇧🇪Belgium herved
Are you sure?
I just tried with 9.5.x and 10.1.x and was able to reproduce in both cases.
Indeed the section markup still shows up but this issue only resolves the extra field markup.
For sections I think this is up to layouts to check for emptiness and not render if that's the case.The markup for a published node is as follows:
<div class="layout layout--onecol"> <div class="layout__region layout__region--content"> <!-- START: this is what the patch removes --> <div class="block block-layout-builder block-extra-field-blocknodearticlecontent-moderation-control"> <div class="block__content"> </div> </div> <!-- END --> </div> </div>
- 🇺🇸United States smustgrave
So tried retesting and seems like this does work but doesn't fix existing pages. Should we have an upgrade path for those?
- 🇧🇪Belgium herved
There is no upgrade path needed, only a clear cache is required.
Did you clear caches after applying the patch?
Thanks - Status changed to RTBC
about 2 years ago 6:05pm 8 February 2023 - 🇺🇸United States smustgrave
Cleared cache a few times and it finally took.
Thanks for baring with me on that one haha.
The last submitted patch, 11: empty_extra_field_block-3152281-11.patch, failed testing. View results →
- 🇧🇪Belgium herved
Setting back to RTBC.
It looks like the testbot had some issues a few days ago which seem completely unrelated to this patch... after re-queuing the patch the errors disappeared.
https://www.drupal.org/pift-ci-job/2604971 → for reference. - Status changed to Needs work
almost 2 years ago 6:53pm 15 March 2023 - 🇺🇸United States tim.plunkett Philadelphia
An empty post_update hook will force the caches to be cleared, it's worth adding that IMO
- Status changed to Needs review
about 1 year ago 8:29pm 25 January 2024 - 🇺🇸United States chrisolof
I tried applying the patch from #22, but ran into errors due to the removal of Drupal\Core\Security\TrustedCallbackInterface. I think the removal of TrustedCallbackInterface was likely unintentional.
Attached is a re-roll of the patch in #11 against 10.2.x, with the requested post_update hook added so a cache clear is forced.
- last update
about 1 year ago Custom Commands Failed - Status changed to Needs work
about 1 year ago 8:24pm 28 January 2024 - 🇺🇸United States smustgrave
Manually triggered #24 bur appears to have a failure. Didn't do a full review but recommend switching to MR.
- First commit to issue fork.
- Status changed to Needs review
about 1 year ago 11:18am 30 January 2024 - Status changed to Needs work
about 1 year ago 12:36pm 30 January 2024 The Needs Review Queue Bot → tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
- Status changed to Needs review
about 1 year ago 11:20pm 30 January 2024 - Status changed to Needs work
about 1 year ago 3:43pm 2 February 2024 - 🇺🇸United States smustgrave
Left a nitpicky but a comment on the tests if possible to also get a positive assertion.
- Status changed to Needs review
about 1 year ago 4:46am 3 February 2024 - Status changed to Needs work
about 1 year ago 3:06pm 12 February 2024 - 🇺🇸United States smustgrave
Been a few days so moving to NW for the small comment.
- First commit to issue fork.
- Status changed to Needs review
11 months ago 10:46am 25 April 2024 - 🇷🇸Serbia vaish
I resolved the merge conflict and addressed the nitpicks. Moving to needs review.
- Status changed to Needs work
11 months ago 5:02pm 25 April 2024 - 🇺🇸United States smustgrave
Cleaned up the issue summary some.
Appears close but moving to NW to update the missing pieces of the summary, left TBD in there.
- Status changed to Needs review
8 months ago 11:46pm 26 July 2024 - Status changed to RTBC
8 months ago 6:23pm 29 July 2024 - 🇳🇿New Zealand quietone
Triaging the RTBC queue. I didn't find any unanswered questions and the comments in the MR are clear.
Leaving at RTBC.
- 🇫🇷France nod_ Lille
Code seems reasonable, not a subject I'm comfortable committing though. RTBC +1
The Needs Review Queue Bot → tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
- Assigned to shalini_jha
- Status changed to Needs work
4 months ago 11:32am 19 November 2024 - 🇮🇳India shalini_jha
I have checked this MR and found some conflicts, which I have addressed. The pipeline was failing due to an unknown word. After reviewing the existing test method, I added it to the cspell:ignore list, and the pipeline passed successfully. After that, I revalidated the test coverage, and it is working as expected. Let me know if you need any further adjustments!
Kindly review.Failing test :
There was 1 failure: 1) Drupal\Tests\layout_builder\Functional\LayoutBuilderTest::testExtraFields Behat\Mink\Exception\ExpectationException: An element matching css ".block-extra-field-blocknodebundle-with-section-fieldlayout-builder-test-empty" appears on this page, but it should not. /var/www/html/vendor/behat/mink/src/WebAssert.php:888 /var/www/html/vendor/behat/mink/src/WebAssert.php:492 /var/www/html/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php:505
- First commit to issue fork.
- 🇬🇧United Kingdom alexpott 🇪🇺🌍
I think we need to add a positive test in some way - at least the test fails without the fix but this is very fragile as we're depending on the CSS class names for the test - which are not API - therefore I think we need to go to the effort of a positive test case somehow - suggestion left on MR