Clean up todo in InlineBlockEntityOperations::handleEntityDelete() and use isLayoutCompatibleEntity()

Created on 24 October 2018, about 6 years ago
Updated 28 March 2024, 9 months ago

Problem/Motivation

function foo_entity_delete(EntityInterface $entity) {
  $context = EntityContext::fromEntity($entity);
}

This will fail.

Introduced in #2791269: Allow saving pre-existing references to inaccessible items

Proposed resolution

This ticket is now a clean up of a todo and update InlineBlockEntityOperations::handleEntityDelete() to use isLayoutCompatibleEntity()

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Plugin 

Last updated 3 days ago

Created by

🇺🇸United States tim.plunkett Philadelphia

Live updates comments and jobs are added and updated live.
  • Blocks-Layouts

    Blocks and Layouts Initiative. See the #2811175 Add layouts to Drupal issue.

  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

  • Status changed to Needs review almost 2 years ago
  • Status changed to Needs work almost 2 years ago
  • 🇮🇳India ameymudras

    Did a brief code review and the following comment doesn't make sense to me, I think we should reword it. Otherwise, the code looks good
    // We might use the passed entity instead of the unchanged one.

  • 🇮🇳India sahil.goyal

    Made change to the comment as per #30 so the comment is now quite relevant what it supposed to do.

  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    29,284 pass
  • Status changed to Needs review over 1 year ago
  • Status changed to Needs work over 1 year ago
  • 🇺🇸United States smustgrave

    Attempted to replicate this by running the code in the issue summary and I don't get any error in 10.1

    Can someone please confirm if it's still an issue and update the issue summary with additional steps

    Thanks!

  • Issue was unassigned.
  • Status changed to Closed: outdated over 1 year ago
  • 🇺🇸United States tim.plunkett Philadelphia

    I think the codepath described by the test case (introduced in #7) was at one time relevant to how Layout Builder was working, but is not reproducible anymore in core. And I can't think of a reason why you'd need to do it in custom code either.

  • Status changed to Active 9 months ago
  • 🇷🇴Romania amateescu

    There's still a reference in code to this issue in \Drupal\layout_builder\InlineBlockEntityOperations::handleEntityDelete(), let's see if calling isLayoutCompatibleEntity() is possible now.

  • Merge request !7106Fix @todo item. → (Open) created by amateescu
  • Status changed to Needs review 9 months ago
  • 🇷🇴Romania amateescu

    Opened a MR, let's see how it goes.

  • Status changed to Needs work 9 months ago
  • The Needs Review Queue Bot tested this issue.

    While you are making the above changes, we recommend that you convert this patch to a merge request . Merge requests are preferred over patches. Be sure to hide the old patch files as well. (Converting an issue to a merge request without other contributions to the issue will not receive credit.)

  • Pipeline finished with Success
    9 months ago
    Total: 550s
    #124066
  • Status changed to Needs review 9 months ago
  • 🇷🇴Romania amateescu

    Hiding the patches because the MR seems to work well :)

  • Status changed to RTBC 9 months ago
  • 🇺🇸United States smustgrave

    Updated title and solution to mention this seems to be cleaning up a todo and use isLayoutCompatibleEntity().

  • Status changed to Needs review 9 months ago
  • 🇬🇧United Kingdom alexpott 🇪🇺🌍

    Added a question the MR.

  • Status changed to Needs work 9 months ago
  • 🇺🇸United States smustgrave

    Moving to NW for someone to test that proposal.

Production build 0.71.5 2024