Figuring out autowired Dependency Injection of custom services with OOP hooks

I was switching over from using procedural hooks to object-oriented programming (OOP) hooks today. I ran into an error that was confusing to me because I had already defined services:

Cannot autowire service “Drupal\nokoto_social\Hook\ActorHooks”: argument “$activityManager” of method “__construct()” references class “Drupal\nokoto_social\ActivityManager��� but no such service exists. You should maybe alias this class to the existing “nokoto_social.activity_manager” service.

A fragment of SEO history, brought to you by the Wolohan Lumber Company (1964–2006)

Tonight, in the woods about a hundred meters behind our house, my partner found a tag from Wolohan Lumber Company for a Rhododendron catawbiense. This might be the same between-14-and-33-year-old rhododendron that currently lives next to our front door.

A Drupal migration that wraps values in paragraphs

Sometimes the way that we’ve structured a site’s content originally is no longer ideal after several years. Here I’ll share an example of using a Drupal migration to restructure content. This example transforms an entity reference field to a paragraph field that wraps the entity reference.

Cache on delivery

There was a period of two to three years where I conducted a couple technical interviews per week, totaling hundreds of interviews. We were trying to fill a role, and had somewhat esoteric requirements (getting the right personal, technical, and interpersonal skills for our team was quite demanding). One of my favorite questions was this: “Describe in detail what this line of code does: uint8_t value = anAddress[index];

Line in the sand, or, Cache me outside

Recently I’ve been poking at a JIT. Long ago, The Story of Mel captivated me with the line “If a program can’t rewrite its own code, what good is it?” The idea of self-modifying code was fascinating, but also infuriatingly annoying on x86 with its variable instruction length. ARM thankfully makes it pretty straightforward, with uniform instruction sizes (4 bytes).

Batten down the patches

Every now and then, I find myself running a program and think “You know what would be really cool? What if, whenever function is called, MyFunction was called instead? Wouldn’t that be great?!” This thought has rolled around in my head for years, but accomplishing it always seemed to come with baggage I didn’t want to deal with, or complexities I didn’t understand. Using linkers and Objective-C runtime tricks to swap functions is something I’ve done with reckless abandon for decades, but plain C functions at runtime? Yikes.

The time that Bernie Mac didn't come to Athens, Ohio

I first learned about this incident several years after I moved to Athens, from a chatty HVAC repairman. I was reminded of it last weekend when I saw a mural depicting famous people from nearby Nelsonville, in which Bernie Mac’s grandmother was conspicuously absent.

I present to you a true tale of large sums of cash, tricky disguises, lack of due diligence, and several occasions in which an angry audience had to be told that the show was canceled and they would not be getting their $25 back.

Using Drupal migrations to modify content within a site

Drupal’s migration system was primarily designed for migrating data into a site from an older version of Drupal or from some other CMS. Here I present examples of using Migrate API for a different use case: moving and adding content within a site that’s being restructured.