Problem/Motivation

See #2704331: Ability to display block_content entities independently, also outside of Blocks.

Custom blocks (block_content entities) are not designed to be displayed outside of blocks. But as a developer, you would never be able to figure this out.

Proposed resolution

Document it, so that developers in the future can at least find it it in the most logical place in the code. So that they don't need to search the internet and hope to end up at https://www.drupal.org/node/2704331.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Wim Leers created an issue. See original summary.

Wim Leers’s picture

Hydra’s picture

Status: Needs review » Reviewed & tested by the community

This rly helped me, was a hard one to find.

lauriii’s picture

Status: Reviewed & tested by the community » Needs review

Wouldn't this also interfere non-technical users that are only using the UI? Are we sure it is enough to just document this in the class documentation? Of course, this makes it available in api.d.o but it might not be enough for the non-technical users.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

borisson_’s picture

I don't think #4 applies, there is no way that I can see to display a block in another way by just using core.

swentel’s picture

@borisson_ : views, entity reference ? That will render them, but without the block content template.

So yeah, in a way, the best solution is to not allow views or entity reference render them (but not for this patch I guess, and probably over the top). Maybe add it to hook_help as well ?

borisson_’s picture

Ah, good to know @swentel, I completely forgot about that. Adding it to hook_help is a good idea I think.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

undersound3’s picture

Issue summary: View changes

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

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.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: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should 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.

Abhijith S’s picture

FileSize
56.97 KB

Patch #2 applied cleanly on 9.2.x.

after

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

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
Luke.Leber’s picture

This seems like a very serious issue that affects more than just developers. Doesn't this mean that site builders can walk themselves and their clients out of support guarantees simply by configuring a block content entity reference via the user interface?

Given that this issue has been open for almost 5 years, how many sites might already be affected?

Anybody’s picture

joachim’s picture

Status: Needs review » Reviewed & tested by the community

> Doesn't this mean that site builders can walk themselves and their clients out of support guarantees simply by configuring a block content entity reference via the user interface?

That's a good point about reference fields pointing to block content entities. Could do with a follow-up?

Patch here looks good.

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

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should 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.

  • catch committed 681597b on 10.1.x
    Issue #2859197 by Wim Leers, Abhijith S, borisson_, lauriii, swentel,...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Opened a follow-up #3295183: Should custom blocks be referenceable? to discuss the more general issue. But I don't think it hurts to discourage doing this where we can easily then continue trying to discourage it more. Going to be tricky since existing sites might already be doing something with this.

Committed/pushed to 10.1.x and cherry-picked back through to 9.4.x

  • catch committed 3ae1b4b on 10.0.x
    Issue #2859197 by Wim Leers, Abhijith S, borisson_, lauriii, swentel,...
  • catch committed 3d4755b on 9.4.x
    Issue #2859197 by Wim Leers, Abhijith S, borisson_, lauriii, swentel,...
  • catch committed 2e9f33b on 9.5.x
    Issue #2859197 by Wim Leers, Abhijith S, borisson_, lauriii, swentel,...

Status: Fixed » Closed (fixed)

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