Problem/Motivation

It is not possible to filter the inline blocks available for placement by the section to which a block is being added.

#2973615: Add Section delta as extra data on filtered block definitions added the section delta as $extra data on filtered block definitions for non-inline blocks. However, that patch failed to analogously add the section delta for inline blocks. The intent of #2973615 clearly was to affect all blocks (not just non-inline blocks), but that was not the end result so I categorized this as a bug report.

Proposed resolution

Add the delta for inline blocks too.

Remaining tasks

Add tests
Review patch.

User interface changes

API changes

Data model changes

Issue fork drupal-3038981

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jdleonard created an issue. See original summary.

jdleonard’s picture

Assigned: jdleonard » Unassigned
Status: Active » Needs review
FileSize
1002 bytes
jdleonard’s picture

Version: 8.7.x-dev » 8.8.x-dev

Does this need to be fixed in 8.8 before 8.7?

jdleonard’s picture

Version: 8.8.x-dev » 8.7.x-dev
tim.plunkett’s picture

Version: 8.7.x-dev » 8.8.x-dev
Status: Needs review » Needs work
Issue tags: +Blocks-Layouts, +Needs tests

Thanks for the patch!
This will need automated tests.
And yes, it will have to land in 8.8 first

tim.plunkett’s picture

Issue tags: +sprint

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

dpi’s picture

tim.plunkett’s picture

+++ b/core/modules/layout_builder/src/Controller/ChooseBlockController.php
@@ -173,8 +173,13 @@ class ChooseBlockController implements ContainerInjectionInterface {
   public function inlineBlockList(SectionStorageInterface $section_storage, int $delta, $region) {
+    // @todo Explicitly cast delta to an integer, remove this in
+    //   https://www.drupal.org/project/drupal/issues/2984509.
+    $delta = (int) $delta;

This cast isn't needed anymore since the method now specifies int as a type

KapilV’s picture

Status: Needs work » Needs review
FileSize
814 bytes

Address #12.

kim.pepper’s picture

Issue tags: +#pnx-sprint
Rinku Jacob 13’s picture

patch #11 successfully applied for drupal 9.3.x dev

dpi’s picture

Created MR from previous patches, reroll (merge) to 9.3.x

yogeshmpawar made their first commit to this issue’s fork.

vikashsoni’s picture

@dpi and @jdleonard Patch not applying in drupal-9.3.x-dev

dpi’s picture

@vikashsoni I've checked that the patch generated from the MR applies to HEAD of both 9.3 (drupal/core#871c1b7) and 9.4 (drupal/core#1ae88e0) cleanly as of this writing.

Don't use the patch files from this issue, per your screenshot.

Check the doc for how to use patches from MR's.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative

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 the the tests requested in #5

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.