Skip to content
Snippets Groups Projects

Deprecate includes

Open nicxvan requested to merge issue/drupal-2233261:2233261-deprecate-hookhookinfo into 11.x
2 unresolved threads

Closes #2233261

Merge request reports

Members who can merge are allowed to add commits.
Approval is optional
Code Quality is loading
Test summary results are being parsed

Set by to be merged automatically when the pipeline succeeds

Ready to merge by members who can write to the target branch.

Merge details

  • The source branch is 859 commits behind the target branch.
  • 1 commit and 1 merge commit will be added to .
  • Source branch will not be deleted.
  • Auto-merge enabled

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
567 567 }
568 568 if (isset($this->groupIncludes[$hook])) {
569 569 foreach ($this->groupIncludes[$hook] as $include) {
570 @trigger_error($include . ' is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Move the functions in this file to either the .module file or other appropriate location. See https://www.drupal.org/node/3489765', E_USER_DEPRECATED);
  • Maybe something like "Autoloading hook include files ($include) is deprecated..." so we have a common keyword and explanation of what gets deprecated? views.views.inc is deprecated sounds strange to me.

    Also since this is a runtime-only deprecation, it would be good if either phpstan-drupal directly or upgrade_status have some checks for this. We don't really know if an include file is a hook_hook_info() thing or something that's manually loaded. We could add a few known files, or or maybe search for .inc files with an Implements hook... string inside, but I think it doesn't hurt to just recommend to drop any .inc files, really no reason to keep them at this point.

    Edited by Sascha Grossenbacher
  • This only gets called when something is added due to hook_hook_info. We are not deprecating .inc in general. Though some code could manually include a file that is also autoloaded.

  • We are not deprecating .inc in general.

    I know we're not. And that' wouldn't be in core, I meant something for upgrade_status for contrib/custom code to use. Once we deprecate the file flag in hook_theme() and this, there's no reason to keep using .inc files anymore.

  • Please register or sign in to reply
  • 14 15 ->getInstanceFromDefinition(ContentPreprocess::class)
    15 16 ->preprocessNode($variables);
    16 17 }
    18
    19 /**
    20 * Creates a ViewsData object to respond to views hooks.
    21 *
    22 * @return \Drupal\content_moderation\ViewsData
    23 * The content moderation ViewsData object.
    24 */
    25 function _content_moderation_views_data_object() {
  • nicxvan added 1 commit

    added 1 commit

    Compare with previous version

  • nicxvan added 1 commit

    added 1 commit

    Compare with previous version

  • Please register or sign in to reply
    Loading