LostCarPark Drupal Blog: Drupal Advent Calendar day 7 - Extra Field

Drupal Advent Calendar day 7 - Extra Field james Thu, 12/07/2023 - 07:00 Image removed.

Welcome back to the Drupal Advent Calendar, and we’re rounding out the first week with the help of Rodrigo Aguilera (rodrigoaguilera), who’s telling us about the Extra Field module.

My choice for the Drupal advent calendar is Extra field because it is a not-so-popular module that helps me in many projects. It falls into a category that I call “Developer little helpers” since it doesn’t provide any immediate interface or functionality but it makes my life a little bit easier.

I like to keep the different representations of entities in display modes and keep the configurability that Drupal offers…

Tags

LN Webworks: Drupal Coding Standards with Git Hooks: All You Need To Know

Image removed.

Think of good code like a well-put-together puzzle—it's strong, looks good, and is easy to tweak. When you're coding with a team or diving into projects like Drupal, sticking to coding standards is a big deal. That's where Git Hooks come in! 

Git Hooks provides a simple and automated way to guarantee that your code consistently adheres to Drupal’s coding standards. By incorporating Drupal Coding Standards with Git Hooks, developers can effortlessly commit and push code that aligns with the community's guidelines. 

Let’s dive deeper into the world of Git Hooks to understand how they work and put them into action for smoother and more standardized coding practices.

The Significance of Drupal Coding Standards

Drupal's coding standards encompass a set of guidelines for writing consistent, well-structured, and maintainable code. These standards cover various aspects of code development, including:

Four Kitchens: Now’s the time to plan your migration to Drupal 10

Image removed.

Laura Johnson

Senior Engineer

Primarily a backend developer, Laura also loves adding new cross-disciplinary skills to her collection, such as working with themes and frontend frameworks.

January 1, 1970

If your organization is still using Drupal 7 or later, migrating to an up-to-date platform for your website has been looming like a weight on your shoulders. The move to Drupal 10 isn’t easy. It requires a migration of your site and a full redesign to take advantage of the new tools the latest version offers.

Not only do you need someone to write that migration, but you also need to secure the budget to undertake a project like this. As you wait for the right time to get started, the weight of the deadline to begin your migration to Drupal 10 has only grown heavier. After multiple extensions, the Drupal community has set January 5, 2025 as the final end-of-life date for Drupal 7.

What does that mean for your organization? On the one hand, you now have just over a year to start planning a migration before your site loses crucial support. But on the other hand, as many organizations like yours face a similar deadline, you can’t afford to wait much longer. The time to make the move to Drupal 10 is now.

Why you need to start planning for a Drupal 10 migration

If you’ve fallen behind in migrating your site from Drupal 7, you’re not alone. According to the Drupal community, more than 350,000 projects still use that version of the platform as of November 2023 — one-quarter of all Drupal sites.

As a result, you aren’t just facing a hard deadline to relaunch your new site as January 2025 grows closer. You’re also competing with a vast number of organizations just like yours who need to coordinate the same migration with a web development agency partner. Given that it takes an average of six months to complete the sales process to get started on a Drupal 7 migration, you’re already at risk of missing the deadline if you have not yet contacted an agency.

The longer you wait, the less likely you are to find a team with availability to work with you on a migration plan and website redesign before Drupal 7 reaches end-of-life. And, given the stakes involved, your organization can’t afford the risks of sticking on a platform without the vital benefits of ongoing support.

What your organization loses when Drupal 7 reaches end-of-life

Drupal 7 will reach its end of life 14 years after its initial release. If you’re still on the platform, your website will remain accessible after January 5, 2025. However, it will no longer receive feature updates, bug fixes, or security releases from the Drupal community.

This last detail is most critical to your organization. Any security issues discovered after January 2025 may be publicly disclosed, but Drupal will no longer provide any necessary updates. Prior to the announcement of this final extension for Drupal 7, your organization had the option of paying for extended support. But that is no longer the case.

When you work with the right agency partner, you can create a migration plan that will keep your website secure. Fortunately, your organization will be able to better manage ‌site security after the migration is complete. But that’s just one of the advantages made possible by getting your organization started with Drupal 10.

Drupal 10 offers dramatic advantages after migration

Trusting your site with the legacy code of Drupal 7 doesn’t just expose your organization to poor security. It prevents you from taking advantage of dramatic improvements for your site’s users and content editors.

Improved website speed and SEO performance

Fundamentally, your Drupal 10 website will run faster. Dynamic caching reduces page load times by invalidating only the content that has changed. Instead of needing to reload your entire page after a set amount of time, your cache can just reload the block with new information.

Drupal 10 also marks the end of Drupal 7’s jQuery. A large JavaScript library, jQuery was a powerful tool, but modern browsers perform many of the same functions. The up-to-date JavaScript used by Drupal 10 also decreases page load times.

Drupal 10 also supports new formats such as schema.org, Open Graph, and JSON-LD, which increase conversions from search engines. Plus, Drupal 10 supports advanced accessibility features that improve WCAG compliance and further improve SEO rankings.

Better site security and reduced maintenance costs

Drupal 10 improves your site security by including up-to-date protocols and dependencies such as PHP 8, Symfony 6, and CKEditor 5. As earlier versions of these dependencies reach end-of-life, they may be exposed to unpatched security vulnerabilities. Migrating to Drupal 10 avoids delays in getting critical security patches applied to your site.

One of Drupal’s major advantages as an open-source platform is the community’s Security Team, which delivers security advisories and provides guidance to contributed module maintainers on how to resolve potential vulnerabilities. Providing continued support from the community Security Team for all of your site’s contributed modules beyond the upgrade deadline is critical.

Improved content editing experience and efficiency

Drupal’s out-of-the-box CMS experience has always been limited. With Drupal 10, your site editors benefit from the Claro theme, which makes Drupal much easier to use. New image tools and an updated media library also enable better organization of your site’s assets.

Drupal 10 also includes the JavaScript text editor CKEditor 5, which further simplifies content creation and its accessibility. In addition, the platform offers enhanced translation capabilities in multiple languages, which enables your organization to reach a wider audience than ever.

Don’t wait until an emergency before moving to Drupal 10

Upgrading your site from Drupal 7 to Drupal 10 isn’t quick or easy. That’s why so many organizations like yours have been putting off the migration. But the sooner you start preparing your site for the future, the sooner you can take advantage of all Drupal 10 has to offer.

Better still, you gain the added peace of mind knowing your site won’t be exposed to critical vulnerabilities. And you don’t have to start planning on your own. With the right team of Drupal experts, you can make a plan to ensure your site remains stable and secure moving forward.

If this sounds like a plan that will help your organization move forward, we should talk.

The post Now’s the time to plan your migration to Drupal 10 appeared first on Four Kitchens.

cyberschorsch.dev: Elevating Drupal's Capabilities with Redis for Advanced Data Management

Most Drupal installations are using Mysql / MariaDB or Postgres for their data storage which allows Drupal to offer versatile and flexible ways of modeling content, especially building relationships with different content model, i.e. a blog post and a vocabulary with tags. In this blog post I will show you how to use Redis with Drupal for other things besides caching.

LostCarPark Drupal Blog: Drupal Advent Calendar day 6 - Smart Trim

Drupal Advent Calendar day 6 - Smart Trim james Wed, 12/06/2023 - 07:00 Image removed.

Welcome back to day 6 of the Drupal Advent calendar. Behind today’s door is the Smart Trim module, and here’s Mark Casias (markie) to tell us all about it.

Smart Trim allows you to control the length of your content by trimming it intelligently. It is designed to be a focused, lightweight improvement over Drupal core’s current formatter trimming capabilities. The maintainers’ focus is stability and ease-of-use. Customizations to the module are encouraged with template overrides and Smart Trim hook implementations.

After installing and enabling Smart Trim, you will see a “Smart trimmed” option in…

Tags

DrupalEasy: Using DrupalPod for core and contrib development

Image removed.DrupalPod is a browser extension and GitPod configuration that allows Drupal contributors to quickly and easily spin up a personal development environment in their browser without pre-installing anything.

Before we go any further, let's break down some of these concepts a bit more…

GitPod is a cloud development platform - meaning that everything necessary for development is installed in the cloud and the only thing that needs to be installed on one's local machine is a modern web browser. Developers can customize their cloud development environments virtually any way they see fit depending on the nature of their project. GitPod cloud development environments are sometimes called personal development environments, as they are normally created as an alternative to a developer's local development environment.

While GitPod environments will sleep after 30 minutes of inactivity, their current state will not be deleted for 2 weeks (and when pinned, will never be deleted) and can be re-launched via the GitPod Workspaces page

GitPod is a freemium software-as-a-service with a free tier that includes 50 hours/month of usage. 

DrupalPod has two main components - a browser extension (for Firefox and Chrome only) and a set of configuration scripts that customizes a GitPod personal development environment for Drupal core and contributed project (modules, themes, etc…) development.

The DrupalPod browser extension provides a quick way for a Drupal contributor to launch a new personal development environment on GitPod from virtually any Drupal issue queue issue. 

Image removed.

The DrupalPod configuration scripts for GitPod include just about everything a modern Drupal development environment needs, including the drupal/core-dev dependencies (which includes PhpStan, phpcs, and PhpUnit), a complete DDEV-based environment, Xdebug setup out of the box, and a useful tool to help set up a temporary ssh keys for using Git to push changes back to issue forks on Drupal.org in a secure manner.

In addition, every DrupalPod environment includes Drush as well as the Admin Toolbar and Devel modules - all with the idea of making it as easy as possible to focus on the task at hand.

DrupalPod was created and is maintained by Ofer Shaal, who also reviewed this blog post and provided answers to my many questions. Thanks, Ofer!

It is important to emphasize that DrupalPod can completely replace one's local development environment for core and contrib development. 

 

Who is DrupalPod for?

DrupalPod is not just for Drupal contributors who write and commit code changes. It also (and possibly more-importantly) allows non-coders to get more involved in the contribution process by making it easy for them to perform common issue queue tasks like testing merge requests (or patches) and reproducing reported issues. It can also be used for user experience and accessibility reviews, among other tasks. 

 

Getting started

There's a few steps that are required before launching a Drupal issue queue merge request in DrupalPod. Luckily, both are relatively straight-forward:

  1. Install the DrupalPod browser extension in either Firefox or Chrome.  Be sure to use the same browser for the remainder of the steps outlined in this article.
  2. Create a (free) GitPod account and log yourself in through Github. 
  3. Login to your Drupal.org user account.
Image removed.

Note that if you're not interested in making code changes to an existing issue, then the steps marked with an asterisk (*) can be skipped.

 

Launching a development environment

Next, find an issue on Drupal.org that you'd like to work on. If you're planning on making a commit and pushing it back to the issue fork, be sure to click the green "Get push access" button near the top of the issue.

Image removed.

I've created a test issue in the Markdown Easy module issue queue with an issue fork if you'd like to test DrupalPod on an inert issue. The rest of this article will assume you're testing with this issue.

In your browser, click on the DrupalPod browser extension and you should see the interface shown in the screenshot earlier in this article. You'll see that the project (Markdown Easy) and the issue fork for this issue ("markdown_easy-3403460") are pre-selected. Select the "3403460-drupalpod-test-issue" branch, "10.0.9" for the Drupal core version, and "Standard" for the install profile. Since this issue only contains an issue fork and no patches, the "Choose a patch" dropdown can be left blank.

It should be noted that the options for "Drupal core version" are not automatically updated whenever a new version of Drupal core is released, and there may be a delay before the DrupalPod browser extension is updated with the most recent version of Drupal core as an option. 

Image removed.

Then, click on the "Open Dev Env" button and accept the default GitPod configuration settings by clicking the "Continue" button on the GitPod configuration page. By default, GitPod will launch an in-browser version of Visual Studio Code.

Image removed.

Next, GitPod builds your personal development environment using the configuration provided by DrupalPod - depending on several factors, the process to create the environment normally takes just a few minutes. Keep an eye on the terminal output in the Visual Studio Code interface to see when it completes.

Image removed.GitPod is still setting things up.

 

Image removed.GitPod is ready to go.

Another big sign that your personal GitPod development environment is ready is when a web browser opens in the Visual Studio Code interface on the development environment's version of Drupal!

Image removed.

 

To login into Drupal in the GitPod-powered personal development environment use the credentials:

  • Username: admin
  • Password: admin

 

What happens if the project doesn't start up cleanly in GitPod?

A fairly common occurrence (especially when working with older issues) is that during the DrupalPod/GitPod setup phase, a Composer error occurs. This is normally not an issue with DrupalPod, but rather with the issue fork (or patch) being out-of-date and in need of update. 

 

Setting up ssh keys for pushing Git commits

This step is not necessary for those just looking to test patches or merge requests and not make code commits.

Hopefully, improved integration between DrupalPod, GitPod, and git.drupalcode.org will soon render this manual temporary ssh key setup obsolete.

At the current time, in order to push commits from a GitPod personal development environment back to a Drupal.org issue fork, a temporary ssh key pair must be set up. While DrupalPod does an admirable job of trying to streamline the issue, there are still a couple of manual steps involved and the process isn't super-smooth.

Luckily, the process is outlined in the "Contribution Guide" document that automatically opens in a DrupalPod environment (see previous screenshot). Step 5 of this guide instructs the user to run a script in the terminal in order to kick off the process of creating the temporary ssh key pair. Currently, the script launches a pseudo-GUI in the terminal app, which leads to the instructions-template.md file being displayed with the necessary steps.

Image removed.

At this point, it is important to click on "< OK >" in the "If you completed the instructions above - click OK" box. 

Image removed.

Note that this will kick off a command line task that requires your input, requesting you to enter your desired passphrase for your temporary ssh key (I normally just hit "Return" to leave the passphrase blank). Only once this is step complete will you see your new, temporary ssh public key appended to the instructions-template.md document. After this, proceed with steps 1-9 listed in the document.

Once complete, click to < Exit > the pseudo-GUI in the terminal app, then complete step 10 to confirm that the temporary ssh key is working as expected. I have found that the resulting message is semi-clear at best, but as long as you see "Setup was successful" somewhere in the message, you're probably good-to-go.

Image removed.

At this point, I normally close the ssh-related .md documents open in Visual Studio Code and get to work. 

 

Using Git from inside a DrupalPod environment

One aspect of using DrupalPod that is quite important for anyone interested in code contribution is understanding at least a little bit about how the code base is organized.

Here's the short version - the directory that you should pay the most attention to is repos. This is where the project of interest (the one whose issue fork or patch you're working on) is available to you for editing and (more importantly) for performing Git operations on. DrupalPod uses symlinks to ensure everything is running smoothly, and the repos directory is automatically symlinked to the project of interest (regardless if it is a module, theme, or Drupal core).

When DrupalPod is opened for a Drupal core issue, https://github.com/joachim-n/drupal-core-development-project is used for the code base.

Image removed.

Inside the repos directory is the project of interest. To modify a project file, navigate to the file inside the repos directory. If/when you're ready to make a code commit to the issue fork, you may use the Visual Studio Code's Git GUI or the command line (after navigating to the project inside the repos directory.)

Assuming that you properly set up a temporary ssh keypair from the previous section, you should be able to perform a git push from either interface. 

Image removed.

The use of the repos directory is the same regardless of if you're working on a contributed module or Drupal core - the project of interest is in the repos directory.

As a matter of practice, once the GitPod environment is up-and-running, the first thing I do is navigate to the repos/ directory on the command line.

 

Code quality tools

While Drupal's core-dev dependencies are automatically provided in all DrupalPod configurations, they do not work out-of-the box without some configuration (much like as if you installed them yourself in a local development environment.) Setting up code quality tools like phpcs, PhpStan, and PhpUnit for core or contributed modules involves a little bit of configuration that is out-of-scope of this article. More information is available on drupal.org - this material (and much more) is also covered in DrupalEasy's 15-week Professional Module Development course

 

What's next for DrupalPod?

Based on conversations with Ofer Shaal, the primary maintainer of DrupalPod, users can expect the following improvements in the coming months:

Tag1 Consulting: A Guide to Estimating Migrations - How Much Will My Drupal Migration Cost? Part 3/3

Hosted by Michael Meyers, - Managing Director of Tag1 Consulting, and Janez Urevc, Sr. Engineer at Tag 1. This podcast series focuses on the strategies involved in upgrading and migrating Drupal websites and applications. This is the last episode in a mini series in which we aim to answer the common question: “How much will my migration cost?” Spoiler alert: It’s complicated. We team up with Lucas Hedding one more time to help demystify the complexities of estimating your project, delving into unexpected variables that could shake up your budget and reveal why quality assurance is more than just a checkbox. Part 1 | Part 2 | Part 3 Please let us know if you have specific migration-related topics you'd like to see us cover. Or, reach out and let us know if we can be an active part of ensuring your migration is a success! --- For a transcript of this video, see A Guide to Estimating Migrations - How much will my Drupal Migration Cost? - Part 3/3. --- Photo by Julia Craice on Unsplash

Read more michaelemeyers Tue, 12/05/2023 - 06:29

The Drop Times: This Must Be the Place

December is here. In my part of the world, the most livable months are December to February. There will be a drop from the sun's scorching heat to the cooling embrace of misty mornings. We don't have snow. The only heavy snowfall that most of us see will be either in cinemas or in literature.

I have wished for such lovely mornings to last forever. But seasons change. People change. People and their technology contribute to large-scale climate change. Let us make a concerted effort to bring down ICT greenhouse gas emissions, taking a cue from Janne Kalliola's session in DrupalCon Lille, and pave the way for a better tomorrow. 

As the year ends, many people have started taking stocks of their past year in retrospect. So do companies. In mid-October, during DrupalCon Lille, we witnessed Dries taking stock of the state of Drupal in his presentation. He placed Drupal against competing CMS offerings and evaluated their strengths and weaknesses. He explained the new marketing initiative and the Drupal Association's decision to partly sponsor the Web Summit Lisbon with the aid of four leading Drupal agencies. It happened in November. Drupal had a happening booth. Everybody was in a resurgent mood.

Anything good will not go uncontested. It shouldn't, either. A good adversary can be an indication of worth. In recent weeks, if you ask me what the most pertinent point of discussion among Drupalists was, I would say it was about a medium blog post by Maxime Topolov, CEO of Code.Store. It was a critique of Driesnote. Although he published the review by the end of October, it suddenly came into discussion through some recent LinkedIn posts. It is interesting to read counter-narratives.

Coming down to the week in retrospect, TheDropTimes (TDT) published the second part of the interview with Grzegorz Pietrzak. He talks about Droopler to Thomas Elias K. Catch the conversation here. We ran a featured story on the Calender View Module by Matthieu Scarset. Alka Elizabeth did the honors.

In a significant organization news, Mautic started offering live trials by collaborating with DropSolid. After Acquia incorporated Mautic into its offerings and returned it to the community, this was the first break for the open-source marketing automation platform.

Local and regional communities play a remarkable role in strengthening the Drupal ecosystem. The recently concluded DrupalCamp Costa Rica had more than 120 participants. Kazima Abbas gives us a glimpse into the successful DrupalCamp. The 3rd annual EvolveDrupal Ottawa summit has concluded successfully. Evolving Web has also raised a call for session submissions to their next summit in Atlanta, GA, in early 2024.

The next edition of DrupalCon Europe will be in Barcelona from September 24 to 27, 2024. Know the venue in advance. The Bay Area Drupal Camp is returning with a two-day hackathon in San Francisco, tentatively scheduled for April 13 to 15, 2024. You can submit sessions for Florida DrupalCamp 2024 until December 18. Drupal Developer Days 2024 will happen in Burgas, Bulgaria, from June 26 to 28, 2024. The camp needs sponsors. Acquia has announced a webinar on Crafting Human-Centric Digital Experiences: A Guide for Drupal Developers. It will happen on December 14.

We shared a few case studies last week. Read about Evolving Web's Successful Drupal Migration for INSPQ or Pantheon's support to WebMD. Srijan published a case study on Drupal site migration from version 8 to 10. Read how Acquia drives digital transformation for Nestlé.

Drew Webber has written about a security vulnerability in Drupal 7. Catch it here. Enterprise support for PHP 8.0 ended on November 26. It will be wise to upgrade your PHP installation. Starting from Drupal 10.2, developers can use PHP attributes instead of annotations for certain plugins. Goran Nikolovski writes about it. Incidentally, he has also written about a debugging experience in webforms in Drupal 10.

A Brazilian city offers 2,500 spots for free Distance Learning courses in technology. In a video tutorial by D4Drupal, Saranya Ashok Kumar demonstrates how to create custom pagination in a custom module for Drupal 10, 9, and 8. Oliver Davies offers a free 7-day email course dedicated to automated testing and test-driven development in Drupal. The 4th episode of the LocalGov Drupal tutorial series focuses on deploying websites to the cloud using platform.sh. Selwyn Polit invites open collaboration on GitHub for a ready reckoner on Drupaling.

Read about Hux, a tool for managing hooks in Drupal website development. Lee Rowlands writes about PreviousNext's journey toward Drupal frontend nirvana by leveraging Vite, Twig, and Storybook. Bluedrop, a French Drupal agency, advocates conducting a 5-day design sprint to finalize UI/UX design for a Drupal project. The process involves understanding, drawing, deciding, prototyping, and testing.

Luca Lusso writes about the state of modules maintained by SparkFabrik. Allan Chappell writes about the significance of Composer, a dependency manager for PHP. The article published by Four Kitchens contextualizes Drupal projects wherein developers navigate the complexities when dealing with modules that haven't fully transitioned to the next major version of the Drupal framework.

'Beyond Blocks' podcast by Oliver Davies is a comparatively new podcast series about Drupal. The previous episode of the podcast features Niklas Franke, Digital Marketing Manager at Factorial. In it, the guest shares his rich experience organizing Splash awards in Germany.

'Beyond the Build' interview series by Drupal Associaton features Sean Keating from The Michael J. Fox Foundation and Jim Barnthouse from Specbee. Kelly Delaney, the Director of Development at Drupal Association, and Nathan Roach, Marketing Director at Axelerant did the interview. Watch the 3rd episode here.

Talking Drupal podcast episode #426 interviews Stephen Mustgrave about the Needs Review Queue Initiative. Meanwhile, Agiledrop has published an interview about the Next-Drupal project with John Faber, Managing Partner of Chapter Three. Next-Drupal aims to integrate the Next.js frontend with the Drupal backend.

Matt Glaman has shared his talk from Midcamp this year about porting top projects to Drupal 10. The major challenge here is maintaining support for Drupal 9.5 while dealing with deprecated code removed from Drupal 10.

Last but not least, check out the benefits of Drupal LTS (long-term support) from Vimal Joseph's blog post on Zyxware.

There are more stories available out there. But the compulsion to limit the selection of stories is forcing us to put a hard break on further exploration—happy Drupaling folks.

To get timely updates, follow us on LinkedIn, Twitter and Facebook.

Thank you,

Sincerely
Sebin Abraham Jacob
Editor in Chief, TheDropTimes.