Problem/Motivation

In core/modules/block/templates/block.html.twig (and the overriden ones in Classy and Bartik as well), there is the following variable documentation:

 * - block - The full block entity.
 *   - label_hidden: The hidden block title value if the block was
 *     configured to hide the title ('label' is empty in this case).
 *   - module: The module that generated the block.
 *   - delta: An ID for the block, unique within each module.
 *   - region: The block region embedding the current block.

Since #1989568: Remove block config ID from being used as an HTML ID or template suggestion that variable, however, does not exist anymore (see BlockViewBuilder::buildBlock() for proof).

Proposed resolution

Remove the documentation.

Remaining tasks

Contributor tasks needed
Task Novice task? Contributor instructions Complete?
Create a patch Novice Instructions Yes
Review patch to ensure that it fixes the issue, stays within scope, is properly documented, and follows coding standards Novice Instructions Yes

User interface changes

None

API changes

None

Data model changes

None

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug because people following the documentation will produce broken templates
Issue priority In terms of themer's experience this is pretty major, because this is a heavily used template, and people are used to having e.g. a node variable in node.html.twig. In the grand scheme of things, I guess this just qualifies for "normal", though, I presume
Unfrozen changes Unfrozen because it only changes documentation
Prioritized changes Prioritized because it is a bug.
Files: 
CommentFileSizeAuthor
#6 2546754-6.patch5.82 KBsdstyles
PASSED: [[SimpleTest]]: [PHP 5.5 MySQL] 101,320 pass(es). View
#4 2546754-4.patch947 bytesjoshi.rohit100
PASSED: [[SimpleTest]]: [PHP 5.5 MySQL] 101,293 pass(es). View

Comments

tstoeckler created an issue. See original summary.

tstoeckler’s picture

Issue summary: View changes
tstoeckler’s picture

Issue summary: View changes
joshi.rohit100’s picture

Status: Active » Needs review
FileSize
947 bytes
PASSED: [[SimpleTest]]: [PHP 5.5 MySQL] 101,293 pass(es). View
tstoeckler’s picture

Status: Needs review » Needs work

Yay, thanks! A bunch of other files, have this too, though:
- core/modules/system/templates/block--system-menu-block.html.twig
- core/themes/bartik/templates/block.html.twig
- core/themes/classy/templates/block/block.html.twig
- core/themes/classy/templates/block/block--search-form-block.html.twig
- core/themes/classy/templates/block/block--system-menu-block.html.twig

sdstyles’s picture

FileSize
5.82 KB
PASSED: [[SimpleTest]]: [PHP 5.5 MySQL] 101,320 pass(es). View

Hi @tstoeckler I removed unused documentation from all above templates.

sdstyles’s picture

Status: Needs work » Needs review
tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Awesome, thanks a lot!

Wim Leers’s picture

Nice clean-up!

tstoeckler’s picture

Issue summary: View changes
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 0ba2b18 and pushed to 8.0.x. Thanks!

  • alexpott committed 0ba2b18 on 8.0.x
    Issue #2546754 by sdstyles, joshi.rohit100: block.html.twig documents a...

Status: Fixed » Closed (fixed)

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