eiriksm.dev: Social historical code archeology: cronner.module
Violinist.io is well into its seventh year. It has survived a couple of Drupal core major upgrades and remains a profitable SaaS based on Drupal and a vital tool for agencies and organizations. I'm not sure if there is such a thing as social historical code archeology, but if there was, then this blog post might be it. I have long wanted to write some blog posts about the development of violinist.io that not only focused on exciting or interesting technical aspects. Instead I think this will highlight when things do not go as planned, why that was, and maybe something around what it meant at the time comparing to present day?
The project started as a PHP file and proof of concept in Drupal Developer Days Seville 2017. Literally. It was one PHP script placed inside one file. After I got that working I figured I would make it a composer package and run it with Drupal cron. This was the first version of violinist.io. Run the method of a composer package with cron. I made a module to contain this hook_cron implementation. I called it cronner. It was the module to do things on cron so that was the name. The cronner module.
cronner.module was first checked in to git with the revision 55da4a9c:
From 55da4a9c
Date: Thu, 23 Mar 2017 08:38:57 +0100
Subject: [PATCH] This is a site now?
As we may deduce from the commit message, this was a pretty early one in the codebase. More precisely, this was the second commit to the codebase, after some initial scaffolding files. At that point, this was the entire contents of cronner.module:
<?php
/**
* Implements hook_cron().
*/
function cronner_cron() {
$nodes = \Drupal::entityTypeManager()
->getStorage('node')
->loadByProperties([
'type' => 'project'
]);
$q = \Drupal::queue('cronner_project');
foreach ($nodes as $node) {
$q->createItem($node);
}
}
Basically a cron implementation to queue all projects on the site periodically.
Fast forward to 2023 and some reflections around maintaining a codebase. Cronner. I can honestly say that cronner is among my least proud namings in the codebase. The hook_cron implementation is long gone and replaced with all sorts of fancy cloud computing. The name really is misleading now. It contains no cron implementations like that any more. Instead it contains (among other things):
- Schema for the database table called cronner_log
- Some random theme hooks used here and there
- A hook_node_insert implementation that is still the one responsible for adding new projects to the update queue
I have many times wanted to work on extracting parts of cronner.module into separate modules. But fixing bugs, improving test coverage or implementing new features has always been the priority. At this point, from time to time I open the file cronner.module and shudder. But after that initial feeling of annoyance or shame I instead focus on the image of something like the origin life form. Something like a web of branches and roots coming out of a mother plant. Something almost alien-like. The module that started it all, the breathing and growing mother of the codebase.
Some might call it legacy. I call it cronner, the origin mother of the codebase.
Redfin Solutions: Event Organizers Working Group (EOWG)
The Drop Times: Moments to Treasure
Dear Drupal Community,
As the holiday season embraces us, I extend warm Seasons' Greetings from The DropTimes Family! These cherished moments, surrounded by our loved ones, savoring comforting meals, and cherishing each instance together, signify what many consider the most beautiful time of the year.
Amidst this season of togetherness, let's not overlook the parallels between these heartwarming moments and the essence of Drupal. Just as we cherish our connections with family and friends, Drupal thrives on the power of connections—forging a community built on collaboration, shared passion, and innovation.
This extended holiday period offers us a chance to revel in the warmth of our relationships and celebrate the robust network of connections within the Drupal community. It’s a time to pause, reflect, and appreciate the bonds that enrich our personal and professional lives.
As we approach the culmination of the year, surrounded by laughter and love, let’s acknowledge the significance of these connections. Just as the Drupal community comes together to innovate and create, let us also embrace the spirit of unity and collaboration, nurturing relationships and supporting one another.
May these moments of togetherness and shared joy serve as a poignant reminder of the importance of connections—both personal and within our Drupal family—filling our hearts with gratitude, warmth, and a renewed sense of community.
Warm wishes for a joyful holiday season and a Happy New Year!
Last week, The DropTimes had a captivating interview with Daniel Angelov, exploring his remarkable journey in accessibility advocacy. Kazima Abbas skillfully conducted this insightful conversation. Meanwhile, Alka Elizabeth had an engaging email exchange with Jeff Eaton, delving into the Token Module's origin, progress, and prospects. I had the pleasure to capture the festive Christmas celebrations held at the offices of Zoocha and SparkFabrik. You can check it out here . I also had the chance to delve deeper into the Drupal Project Browser Initiative, where Christopher Wells is playing a pivotal role. This initiative represents a significant step forward in enhancing Drupal's user experience and accessibility.
Exciting news from the Drupal 7 security initiative: Klaus Purer, Ivan Tibezh, Juraj Falat, and Andrii Cheredn have joined as new members! Explore their valuable contributions here. In recent updates, a moderately critical security risk has been identified in the data visualization framework module within Drupal. Dominique De Cooman, Dropsolid's Co-Founder and Co-CEO, achieves a remarkable milestone by securing a seat on the esteemed Mautic Community Council. Discover more about this remarkable achievement in the news article.
Introducing the Drupal Geysir Module! This latest release brings a collection of user interface improvements aimed at streamlining content authors' daily workflow. Dive into its transformative impact on Drupal's user experience right here. Guided by CEO Tim Doyle, the Drupal Association achieved significant milestones in 2023 through a visionary 3-year plan, fostering innovation, expanding outreach, and boosting support. Read more about it here.
Exciting news from DrupalCamp Belgium 2024. The call for speakers is now open until March 10, 2024. Don't miss this opportunity to share your insights and participate in this dynamic event. Join the exceptional Drupal Mountain Camp 2024 - organizers seek potential sponsors for this remarkable event. Click here for details on involvement. Dive into the dynamic world of design systems on January 17, 2024, at iO Campus Amsterdam during the 'Insightful Design Systems' meetup. Professionals across fields are invited to explore the intricacies of design systems in this engaging event.
At DrupalCon Portland 2024, Julia Kranzthor, Director of Philanthropy at the Drupal Association, unveils the return of the Nonprofit Summit, fostering collaboration and innovation for nonprofits leveraging Drupal.
Fresh off the press: Adam Bergstein's latest release, "Drupal 10 Masterclass: A Comprehensive Guide for Beginners," is now available on Amazon. Tailored specifically for beginners, this book is a must-read for those diving into Drupal.
While more stories beckon for exploration, constraints compel us to halt further selection. To get timely updates, follow us on LinkedIn, Twitter and Facebook.
Thank you,
With warm wishes,
Elma John
Sub-Editor, TheDropTimes
Specbee: A Deep Dive into the Webform Module for Drupal 10
Golems GABB: Enhancing Site Performance with Drupal's BigPipe Module
Nowadays, the stakes are getting higher and higher. Speed is of the essence for an ordinary user, and each web page and developer has to comply with it. This is where Drupal's BigPipe module takes the stage.
BigPipe is not a simple addition but a powerful tool for ensuring faster page loading times. It is achieved by fragmenting a web page into smaller units and prioritizing their loading order. Following this logic, the most crucial parts will be loaded first, while the others will catch up later. Let's delve deeper into this marvelous technology and learn more about web page optimization using Drupal's BigPipe module.
LN Webworks: Top 7 Secrets No One Told You For The Success of Drupal Web Development Projects
Drupal has solidified its position as a go-to content management system and web development framework, earning the trust of businesses and developers worldwide. As more organizations lean on Drupal for their web development needs, the demand for top-tier projects, handled by a seasoned Drupal development company, is on the rise.
In this article, we're delving into the seven secrets that set the best Drupal web development projects apart. These are some core industry insights from the top Drupal website development companies for higher chances of project success.
The Drop Times: The Essential API Client for Seamless JavaScript Integration
Talking Drupal: Talking Drupal #430 - Drupal in 2024
Today we are talking about Drupal in 2024, What we are looking forward to with Drupal 11, and the Drupal Advent Calendar with James Shields. We’ll also cover Drupal 10.2 as our module of the week.
For show notes visit: www.talkingDrupal.com/430
Topics- Advent calendar
- Selection process
- Popularity
- Next year
- Drupal features in 2024
- Drupal 11
- Project browser
- Recipes / Starter templates
- Automated updates
- Gitlab
- Smaller core
- Predictions
- Drupal Advent Calendar
- A Plan for Drupal 11
- Drupal 10.2 announcement
- Change Records for 10.2.0
- Dev Days
James Shields - lostcarpark.com lostcarpark
HostsNic Laflin - nLighteneddevelopment.com nicxvan John Picozzi - epam.com johnpicozzi Martin Anderson-Clutz - mandclu Ron Northcutt - community.appsmith.com rlnorthcutt
MOTW CorrespondentMartin Anderson-Clutz - mandclu Drupal 10.2
- Improvements include
- Technology Updates
- PHP 8.3
- Includes capabilities that previously required contrib projects
- File name sanitization
- A search filter on the permissions page
- End Users
- Performance enhancements and improved caching APIs
- Support for PHP Fibers to accelerate handling things like asynchronous remote calls
- Content Creators
- Revision UI for media
- Wider editing area in Claro on large screens
- The return of “Show blocks” in CKEditor 5, missing until now
- Site Builders
- Field creation UI has a new, more visual interface, and an updated workflow
- Block visibility can now be based on the HTTP response status, for example to make it visible or invisible on 404 or 403 responses
- Tour module is no longer enabled by default for the Standard and Umami profiles
- New “negated regular expression” operator for views filters (string/integer), to exclude results matching a provided pattern
- Site Owners
- Announcements Feed is now stable and included in the Standard profile
- The functionality in the experimental Help Topics module has been merged into the main Help module, so the Help Topics module is now deprecated
- New permission: Use help pages
- Developers
- A fairly sizable change is a move to use native PHP attributes instead of doctrine annotations to declare metadata for plugin classes. Work is already underway to get core code converted, and an issue has been opened to have rector do this conversion for contrib projects
- A new DeprecationHelper::backwardsCompatibleCall() method to help write Drupal extensions that support multiple versions of core
- A PerformanceTestBase is now in core, to support automated testing of performance metrics
- A new #config_target property in ConfigFormBase to simplify creating configuration forms
- Symfony mailer is now a composer dependency of core
- New decimal primitive data type
- Expanded configuration validation, Symfony autowiring support, HTML5 output from the HTML utility class is now default, and more
- In addition to these and the features highlighted in the official announcement, there are three pages of change records for the 10.2.0 release, and we’ll include a link to those in the show notes
- Technology Updates
#! code: Drupal 10: Creating Custom Paths With Path Processors
Routes in Drupal can be altered as they are created, or even changed on the fly as the page request is being processed.
In addition to a routing system, Drupal has a path alias system where internal routes like "/node/123" can be given SEO friendly paths like "/about-us". When the user visits the site at "/about-us" the path will be internally re-written to allow Drupal to serve the correct page. Modules like Pathauto will automatically generate the SEO friendly paths using information from the item of content; without the user having to remember to enter it themselves.
This mechanism is made possible thanks to an internal Drupal service called "path processing". When Drupal receives a request it will pass the path through one or more path processors to allow them to change it to another path (which might be an internal route). The process is reversed when generating a link to the page, which allows the path processors to reverse the process.
It is possible to alter a route in Drupal using a route subscriber, but using path processors allows us to change or mask the route or path of a page in a Drupal site without actually changing the internal route itself.
In this article we will look what types path processors are available, how to create your own, what sort of uses they have in a Drupal site, and anything else you should look out for when creating path processors.
Types Of Path Processor
Path processors are managed by the Drupal class \Drupal\Core\PathProcessor\PathProcessorManager. When you add your a path processor to a site this is the class that manages the processor order and calling the processors.
There are two types of path processor available in Drupal: