Problem/Motivation

InlineBlockUsage was added as an internal class, but as a public service it deserves an interface now.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 3043797-blockusage-2.patch9.33 KBtim.plunkett

Comments

tim.plunkett created an issue. See original summary.

tim.plunkett’s picture

Status: Active » Needs review
StatusFileSize
new9.33 KB
johnwebdev’s picture

Status: Needs review » Reviewed & tested by the community

Patch looks good to me, making it public is also nice for contrib if they need to extend it (i.e. thinking of asymmetric translation if we decide it should not be part of core).

phenaproxima’s picture

Change record written: https://www.drupal.org/node/3043944.

The interface docs look pretty basic, but it doesn't need to be elaborate at this point, since the inline block stuff isn't really an API. We can beef up the docs later as needed! +1 RTBC.

  • xjm committed f4f6026 on 8.8.x
    Issue #3043797 by tim.plunkett, johndevman, phenaproxima: Create an...

  • xjm committed a349b6b on 8.7.x
    Issue #3043797 by tim.plunkett, johndevman, phenaproxima: Create an...
xjm’s picture

Status: Reviewed & tested by the community » Fixed

Yeah there's a couple small oddities in the docs, e.g.:

+++ b/core/modules/layout_builder/src/InlineBlockUsageInterface.php
@@ -0,0 +1,60 @@
+   * Delete the inline blocks' the usage records.

Extra "the".

However, since this is essentially moved code, fixing up the docs is out of scope.

That said:

FILE: .../layout_builder/src/EventSubscriber/SetInlineBlockDependency.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 11 | WARNING | [x] Unused use statement
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Fixed on commit like so:

diff --git a/core/modules/layout_builder/src/EventSubscriber/SetInlineBlockDependency.php b/core/modules/layout_builder/src/EventSubscriber/SetInlineBlockDependency.php
index 7755e33d5c..23e965be86 100644
--- a/core/modules/layout_builder/src/EventSubscriber/SetInlineBlockDependency.php
+++ b/core/modules/layout_builder/src/EventSubscriber/SetInlineBlockDependency.php
@@ -8,7 +8,6 @@
 use Drupal\Core\Database\Connection;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
-use Drupal\layout_builder\InlineBlockUsage;
 use Drupal\layout_builder\InlineBlockUsageInterface;
 use Drupal\layout_builder\LayoutEntityHelperTrait;
 use Drupal\layout_builder\SectionStorage\SectionStorageManagerInterface;

Committed to 8.8.x, cherry-picked to 8.7.x, and published the change record. Thanks!

johnwebdev’s picture

Status: Fixed » Closed (fixed)

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