Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By dawehner on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Issue links:
Description:
As a coding standard, all special attributes on the request object should be prefixed with an underscore.
Thus, if a module or service adds to the request attributes directly, the key name should start with "_".
This will avoid conflicts with values populated based on path placeholders (a.k.a. slugs) like node from the /node/{node} path pattern.
Some of the conversions done in #2052389: All elements added to the Request attributes should have a _ prepended unless they come from the path:
$request->attributes->get('system_path')
to$request->attributes->get('_system_path')
$request->attributes->get('drupal_menu_item')
to$request->attributes->get('_drupal_menu_item')
Comments
Define "special"
Define "special"
I think we can simply follow
I think we can simply follow the guideline that's part of the issue title: "All elements added to the Request attributes should have a _ prepended unless they come from the path"
Started on a doc page:
Started on a doc page: https://drupal.org/node/2084027
---
Work: BioRAFT