.../block_content/src/Entity/BlockContent.php | 5 +++++ .../quickedit/src/Tests/QuickEditLoadingTest.php | 24 +++++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/core/modules/block_content/src/Entity/BlockContent.php b/core/modules/block_content/src/Entity/BlockContent.php index 2d02dda..257043c 100644 --- a/core/modules/block_content/src/Entity/BlockContent.php +++ b/core/modules/block_content/src/Entity/BlockContent.php @@ -55,6 +55,11 @@ * field_ui_base_route = "entity.block_content_type.edit_form", * render_cache = FALSE, * ) + * + * Note that render caching of block_content entities is disabled because they + * are always rendered as blocks, and blocks already have their own render + * caching. + * See https://www.drupal.org/node/2284917#comment-9132521 for more information. */ class BlockContent extends ContentEntityBase implements BlockContentInterface { diff --git a/core/modules/quickedit/src/Tests/QuickEditLoadingTest.php b/core/modules/quickedit/src/Tests/QuickEditLoadingTest.php index 682f2cd..5865655 100644 --- a/core/modules/quickedit/src/Tests/QuickEditLoadingTest.php +++ b/core/modules/quickedit/src/Tests/QuickEditLoadingTest.php @@ -8,11 +8,10 @@ namespace Drupal\quickedit\Tests; use Drupal\Component\Serialization\Json; -use Drupal\simpletest\WebTestBase; -use Drupal\quickedit\Ajax\MetadataCommand; -use Drupal\Core\Ajax\AppendCommand; use Drupal\Component\Utility\Unicode; +use Drupal\block_content\Entity\BlockContent; use Drupal\node\Entity\Node; +use Drupal\simpletest\WebTestBase; /** * Tests loading of in-place editing functionality and lazy loading of its @@ -493,4 +492,23 @@ public function testConcurrentEdit() { } } + /** + * Tests that Quick Edit's data- attributes are present for content blocks. + */ + public function testContentBlock() { + \Drupal::service('module_installer')->install(array('block_content')); + + // Create and place a content_block block. + $block = BlockContent::create([ + 'info' => $this->randomMachineName(), + 'type' => 'basic', + 'langcode' => 'en', + ]); + $block->save(); + $this->drupalPlaceBlock('block_content:' . $block->uuid()); + + // Check that the data- attribute is present. + $this->drupalGet(''); + $this->assertRaw('data-quickedit-entity-id="block_content/1"'); + } }