diff --git a/docroot/modules/custom/ncids_html_transformer/src/Services/NcidsEmbeddedEntitiesTransformer.php b/docroot/modules/custom/ncids_html_transformer/src/Services/NcidsEmbeddedEntitiesTransformer.php index babd4c3edd..3a26bdd9bb 100644 --- a/docroot/modules/custom/ncids_html_transformer/src/Services/NcidsEmbeddedEntitiesTransformer.php +++ b/docroot/modules/custom/ncids_html_transformer/src/Services/NcidsEmbeddedEntitiesTransformer.php @@ -70,6 +70,7 @@ public function transform(string $html): string { break; case 'view_mode:block_content.full': + $drupal_embed->setAttribute('data-embed-button', 'insert_content_block_content'); break; default: diff --git a/docroot/modules/custom/ncids_html_transformer/tests/src/Unit/NcidsEmbeddedEntitiesTransformerTest.php b/docroot/modules/custom/ncids_html_transformer/tests/src/Unit/NcidsEmbeddedEntitiesTransformerTest.php index bfed3711b0..49b07f3a51 100644 --- a/docroot/modules/custom/ncids_html_transformer/tests/src/Unit/NcidsEmbeddedEntitiesTransformerTest.php +++ b/docroot/modules/custom/ncids_html_transformer/tests/src/Unit/NcidsEmbeddedEntitiesTransformerTest.php @@ -184,4 +184,32 @@ public function testExternalLinkBlockNoImageHtml() { $this->assertEquals($expected_html, $post_processed, 'Should transform external link blocks with new embed button for no image view mode.'); } + /** + * Test content block migration with block_content.full. + * + * @covers ::transform + */ + public function testContentBlock() { + $original_html = + ' '; + $expected_html = + ' '; + + // Simulate full transformation process. + $pre_processed = $this->transformer->preProcessHtml($original_html); + $transformed = $this->transformer->transform($pre_processed); + $post_processed = $this->transformer->postProcessHtml($transformed); + $this->assertEquals($expected_html, $post_processed, 'Should transform content block.'); + } + }