Drupalize.Me: Drupal 11.1 Adds Hooks as Classes: A History, How-To, and Tutorials We’ve Updated

Drupal 11.1 Adds Hooks as Classes: A History, How-To, and Tutorials We’ve Updated

With the release of Drupal 11.1, there’s a cool new feature for developers: Hooks can now be implemented as class methods using PHP attributes instead of functions. This change is a major step forward in modernizing Drupal’s codebase. While procedural function-based hooks are still supported (and will be for some time), developers writing new code should strongly consider using the object-oriented (OOP) approach introduced in Drupal 11.1.

One of our core commitments at Drupalize.Me is ensuring that our tutorials remain accurate and relevant as Drupal evolves. So we’re working on updating all of our tutorials to take into account the new OOP approach to adding hooks in a module. We’re also aware that procedural hooks have been around for 24 years, and aren’t going to disappear overnight. You’ll see them in example code and existing documentation for a long time to come. So for now we’ll be including both approaches in our content whenever doing so makes sense.

You should plan on learning both approaches, and then using the one that makes the most sense given your specific case.

Continue reading to learn a bit about the evolution of hooks in Drupal core and how to implement hooks as classes in Drupal 11 in this latest Drupalize.Me blog post by Joe Shindelar.

joe
Fri, 01/31/2025 – 18:25

This Sculpt OS video walkthrough explains how to use Sculpt OS

We talk about the Genode project and Sculpt OS quite regularly on OSNews, but every time I’ve tried using Sculpt OS, I’ve always found it so different and so unique compared to everything else that I just couldn’t wrap my head around it. I assume this stems from nothing but my own shortcomings, because the Genode project often hammers on the fact that Sculpt OS is in daily-driver use by a lot of people within and without the project, so there must be something here just not clicking for me. Well, it seems I’m actually not the only one with difficulties getting started with Sculpt OS’ unique structure and interface, because Norman Feske, co-founder of Genode Labs, has published a lengthy, detailed, but very interesting and easy to follow screencast explaining exactly how to use Sculpt OS and its unique features and characteristics. Even though Sculpt OS has been in routine daily use for years now, many outside observers still tend to perceive it as fairly obscure because it does not follow the usual preconceptions of a consumer-oriented operating system. Extensive documentation exists, but it leaves a fairly technical impression at a cursory glance, which may scare some people away. The screencast below aims at making the system a little bit more approachable. It walks you through the steps of downloading, installing, booting the system image, navigating the administrative user interface, and interactively extending and customizing the system. The tour is wrapped up with the steps for creating your personal sculpted OS on a bootable USB stick. ↫ Norman Feske After watching this, I genuinely feel I have much better grasp of how to use Sculpt OS and just how powerful it really is, and that it’s really not as difficult to use as it may look at first glance. The next time I set some time aside for Sculpt OS, I feel I’ll have a much better grasp of what to do and how to use it properly.

Canada’s New Open Work Permit Restrictions: What You Need to Know

Canada is renowned for its welcoming immigration policies, but recent reforms to Open Work Permits (OWPs) signal a shift in priorities. Effective January 21, 2025, the government is implementing significant restrictions on OWPs for family members of international students and foreign workers. Here’s a breakdown of the changes and what they mean for prospective applicants.

The Drop Times: Making Drupal CMS Truly User-centered

From its inception at DrupalCon Portland 2024 to the official launch of Drupal CMS 1.0, user experience (UX) has been at the forefront of development. Join Emma Horell, UX Manager at the University of Edinburgh, as she reflects on the key UX strategies and milestones that have shaped this groundbreaking product, ensuring it meets the needs of non-technical audiences and keeps the user at its core.

Refresh your home-screen

This Week in F-Droid

TWIF curated on Thursday, 30 Jan 2025, Week 5

F-Droid core

F-Droid and F-Droid Basic were updated to 1.22.0 stable, but not yet ‘suggested’. If you’ve missed the quick alpha version you can read the list of changes.

Current changelog since the alpha is short:

  • automatically add newly installed apps to home-screen for most launchers (Thanks Dhina!)
  • disable gentle app updates again because of update issues (Find out why here)
  • some bug fixes

As usual we ask brave users to test this release and offer feedback as soon as possible. How to install this release? In F-Droid Client, on its own page, either scroll down, expand Versions and install the latest, or in the upper right menu choose “Allow Beta updates”.

Community News

Does IOCipher ring any bells for you as a developer? If so, you’d be informed that @Zoff, the developer behind Trifa – Tox Client, has picked up maintaining a fork of IOCipher and updated to version 1.0. You’ll have to adapt your code a bit so do read about this community reboot here.

Delta Chat and ArcaneChat were updated to 1.52.0, with fixes all around. That aside, their push of Webxdc is getting more traction, across protocols and with many more apps for users to drop in their chats. Were you rehearsing your elevator pitch for the moment you see a VC going up? Maybe you need to cross out some of those app ideas as Webdxc might replace billionairish platforms with ZIP files.

Dolphin Emulator was updated to 2412, and you can read about all the new goodies while it installs. Oh, wait, I lied, Release 2407 and 2409 notes will take you at least 30 minutes, and you might need to grab a beverage as Release 2412 notes will need 40 more.

KDE Connect was updated to 1.32.11, and maybe you should keep an eye on any popups about the update being blocked, as some reported this week and last week.

NewPipe was updated to 0.27.5, fixing one of the recent issues with Youtube, the other issue that stops videos at 59 seconds is work in progress.

Tarnhelm version 1.6.6 was rebuilt, to fix an issue with Xposed API, so now it’s missing for one cycle but it will come back in the next one along with the next version.

@linsui transfers our words:

CatShare, App for Mutual Transmission Alliance, was just added. Do you have a phone made in China which comes with a convenient file transfer function? Some phones made in China support Mutual Transmission Alliance in the stock ROM but this function is not available in FOSS ROMs such as LineageOS. CatShare is a FOSS implementation of Mutual Transmission Alliance protocol. Now you can transfer files between any ROM with Mutual Transmission Alliance protocol thanks to the power of FOSS.

Ciyue was updated to 1.0.0, bringing multiple dictionaries support. The external storage permission is removed, therefore when upgrading from old versions the dicts won’t work anymore. Please clear the data and import them again.

Removed Apps

2 apps were removed as announced last week
  • Podcini.R – Podcast instrument: Modern, feature-rich, capable of handling Youtube and YT Music contents
  • VPN Hotspot: tethering/Wi-Fi repeater

Newly Added Apps

4 more apps were newly added

Updated Apps

145 more apps were updated

(expand for the full list)

Thank you for reading this week’s TWIF 🙂

Please subscribe to the RSS feed in your favourite RSS application to be updated of new TWIFs when they come up.

You are welcome to join the TWIF forum thread. If you have any news from the community, post it there, maybe it will be featured next week 😉

To help support F-Droid, please check out the donation page and contribute what you can.