Deprecate includes
Closes #2233261
Merge request reports
Activity
added 2 commits
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
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() { I am doing that here: https://www.drupal.org/project/drupal/issues/3489415
I'll update it to use DI too.
Edited by nicxvan