# Talking Drupal #510 - Drupal Hooks: Drop 'em like their hot Today we are talking about Drupal Hooks, why they got changed in core, and what to do now with guest Karoly Négyesi better known as Chx. We’ll also cover Media Folders as our module of the week. For show notes visit: [https://www.talkingDrupal.com/510](https://www.talkingDrupal.com/510) ## Topics * Deep Dive into Drupal Hooks * The Evolution of Drupal Hooks * Challenges and Solutions in Hook Conversion * Community Involvement and Contributions * The Future of Drupal Hook System * Introduction to Procedural Hooks * Understanding Theme Hooks * Complexities of Preprocess Hooks * Converting Hooks to Object-Oriented * Impact on Contributed Modules * Challenges in Core Conversion * Future of Drupal Hooks * Lightning Round and Conclusion ## Resources * [Hooks becoming OOP](https://www.drupal.org/project/drupal/issues/3442009) * [Convert everything everwhere all at once](https://www.drupal.org/project/drupal/issues/3483599) * [Conversion script](https://gitlab.com/-/snippets/3762254) * [Conversion patches](https://gitlab.com/-/snippets/3762254) * [Ordering hooks OOP](https://www.drupal.org/project/drupal/issues/3485896) * [Preprocess hooks](https://www.drupal.org/project/drupal/issues/3495943) * [Render API change](https://www.drupal.org/node/3525331) * [2009 issue for form api ungrokable](https://www.drupal.org/project/drupal/issues/367006) * [2007 change for calling themes hook](https://www.drupal.org/project/drupal/issues/130987) * [Giant issue with all of the hook related links](https://www.drupal.org/project/drupal/issues/3533074) * [Longest hook in core: entity_query_tag__entity_test_mulrev__entity_query_entity_test_mulrev_alter_tag_test_alter](https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/field/tests/modules/field_test/src/Hook/FieldTestHooks.php?ref_type=heads#L184) ## Guests Károly Negyesi - [ghost-of-drupal-past](https://www.drupal.org/u/ghost-of-drupal-past) ## Hosts Nic Laflin - [nLighteneddevelopment.com](https://www.nLighteneddevelopment.com) [nicxvan](https://www.drupal.org/u/nicxvan) John Picozzi - [epam.com](https://www.epam.com) [johnpicozzi](https://www.drupal.org/u/johnpicozzi) Martin Anderson-Clutz - [mandclu.com](https://mandclu.com) [mandclu](https://www.drupal.org/u/mandclu) ## MOTW ### Correspondent Martin Anderson-Clutz - [mandclu.com](https://mandclu.com) [mandclu](https://www.drupal.org/u/mandclu) * Brief description: * Have you ever wanted to have your Drupal site's media assets presented in a UI that evokes the hierarchy of a filesystem? There's a module for that. * Module name/project name: * [Media Folders](https://www.drupal.org/project/media_folders) * Brief history * How old: created in Apr 2025 by João Mauricio (jmauricio) * Versions available: 1.0.3 which supports Drupal 10.3 and 11 * Maintainership * Actively maintained * Security coverage * Test coverage * Number of open issues: 9 open issues, 2 of which are bugs, although one was just fixed * Usage stats: * 61 sites * Module features and usage * The module mimics a file structure by associating media entities with a taxonomy hierarchy * It then provides an intuitive, drag-and-drop UI to move items between locations, drag in new items, or even search within a particular “folder”, including a recursive search * When you drag in files, it uses “smart” logic to automatically assign files to Media bundles * It provides a form display widget, a view display widget, a CKEditor plugin, and it’s compatible with other filesystem modules, like S3 File System * This kind of interface is a requirement I’ve seen in RFPs by companies looking for a new CMS, so having this available as a drop-in solution 00:00 Introduction to Talking Drupal 00:39 Meet the Guest: Oli Nehi (chx) 01:46 Module of the Week: Media Folders 07:19 Deep Dive into Drupal Hooks 11:54 The Evolution of Drupal Hooks 15:46 Challenges and Solutions in Hook Conversion 26:09 Community Involvement and Contributions 34:31 The Future of Drupal Hook System 37:21 Introduction to Procedural Hooks 37:54 Understanding Theme Hooks 39:34 Complexities of Preprocess Hooks 41:49 Converting Hooks to Object-Oriented 45:08 Impact on Contributed Modules 51:03 Challenges in Core Conversion 59:02 Future of Drupal Hooks 01:04:33 Lightning Round and Conclusion