Block Field is a useful module when used with Paragraphs.

Currently this works quite well but the collapsed / closed summary is missing.

This patch adds the summary.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yobottehg created an issue. See original summary.

yobottehg’s picture

Assigned: Unassigned » yobottehg
Status: Active » Needs review
FileSize
708 bytes
yobottehg’s picture

Assigned: yobottehg » Unassigned
yobottehg’s picture

rebased the patch on the latest changes in dev

miro_dietiker’s picture

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

Yeah, as block field is pretty common, we could add support.
Hopefully we will find a better approach for a generic summary approach.
Pity we can't rely on some generic builtin summary / label functionality.

That said, the magic word to pass the wall is "tests" :-)

VladimirMarko’s picture

Assigned: Unassigned » VladimirMarko

Let's write some tests.

VladimirMarko’s picture

The last submitted patch, 7: add_support_for_block-2899322-7-test-only.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Status: Needs review » Needs work

The last submitted patch, 7: add_support_for_block-2899322-7.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

VladimirMarko’s picture

The last submitted patch, 10: add_support_for_block-2899322-10-test-only.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Status: Needs review » Needs work

The last submitted patch, 10: add_support_for_block-2899322-10.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

VladimirMarko’s picture

The last submitted patch, 13: add_support_for_block-2899322-13-test-only.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Status: Needs review » Needs work

The last submitted patch, 13: add_support_for_block-2899322-13.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

VladimirMarko’s picture

The last submitted patch, 16: add_support_for_block-2899322-16-test-only.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Berdir’s picture

Status: Needs review » Needs work
+++ b/src/Entity/Paragraph.php
@@ -458,6 +458,15 @@ class Paragraph extends ContentEntityBase implements ParagraphInterface {
+      if ($field_definition->getType() == 'block_field') {
+        if (!in_array($field_name, ['type', 'uid', 'revision_uid'])) {

I don't see why the field name check here is necessary, a block_field is never going to be named like that.

Also, a comment to explain what this does would be good.

yobottehg’s picture

Assigned: VladimirMarko » yobottehg

I'll fix this copy/pasta from me.

yobottehg’s picture

Assigned: yobottehg » Unassigned
Status: Needs work » Needs review
FileSize
4.26 KB

Removed the field name check, that was copy pasted from the entity_reference field. Added a comment for describing the functionality of the new feature.

Berdir’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs tests

Thanks, don't forget to provide an interdiff when updating a patch.

Needs a . at the end of the comment, looks fine otherwise.

miro_dietiker’s picture

Status: Reviewed & tested by the community » Fixed

Committed. :-)

Status: Fixed » Closed (fixed)

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