DrupalEasy: Debugging all the things with Xdebug, DDEV, PhpStorm, PhpUnit

Image removed.Over the past few years, we've published a couple of blog posts about setting up Xdebug for Drupal module development. But, like all things in tech, there's always more to learn as tools and technology evolve.

The setup

I was recently working with one of our Professional (Drupal) Module Development students trying to determine why she wasn't able to use Xdebug to debug a PhpUnit-based functional test. To be clear, the breakpoint wasn't set in the actual test class, the breakpoint was set in some custom module code that was called by the test class.

In functional tests, Guzzle is used by PhpUnit to make calls like:

$this->drupalGet('')

So, in a way, there isn't a direct PHP connection between test class and the code under test. It is in this circumstance that the breakpoint wasn't working.

Xdebug was working fine for this student to debug other aspects of the same project - it just wasn't hitting breakpoints during functional tests.

The solution

This was one of those instances that I had seen (and solved) previously, but to be honest, PhpStorm/Xdebug solutions have often involved numerous trips into the (extensive) PhpStorm settings area. By the time the problem is fixed, I was never 100% sure exactly which change I made had actually solved the problem. But, this time, I was more careful…

Image removed.

Obviously, Xdebug must be enabled in DDEV, and PhpStorm's almost-magical auto-configuration for Xdebug needs to have configured a new "Server" with proper path mappings (especially for the project root).

The PhpStorm configuration settings related to Xdebug that I now recommend are:

  • Set the "Max connections" value to 20 in the "PHP | Debug" configuration area (see image above).
  • Uncheck the “Force break at the first line when no path mapping is specified,” "Force break at first line when a script is outside the project" and "Ignore external connections through unregistered server configurations" checkboxes in the "PHP | Debug" configuration area (see image above.)
  • Set "Host" and "Name" in the "PHP | Servers" configuration are the same (and of the form name.ddev.site, where name is your site's DDEV machine name) (see image below.)
  • When running functional tests, PhpStorm may request to see up a new server connection in "PHP | Servers" with the name "localhost." Allow it and ensure the path mapping is correct.

With these settings, functional PhpUnit tests can be effectively debugged. 

Image removed.

DrupalEasy: DrupalCon Pittsburgh 2023 Superlatives

Unless you've been living underneath a Druplicon-shaped rock, you're probably aware that DrupalPalooza Pittsburgh took place June 5-8. If so, I'm guessing that your Drupal newsfeed is full of wrap-up articles and summaries that may feel a bit redundant (I know that mine is and that they do).

It is in the spirit of hopefully spicing up your Drupal news consumption that this will not be one of those blog posts. Rather, in my somewhat still high-school-aged mind, I'm rolling back the clock to present the DrupalCon Pittsburgh 2023 Superlatives 🎉

Best session (that I attended): Drupal Distributions & Recipes Initiative Update - but don't get too excited, Mr. Jim Birch (the presenter) 😜, as I really don't go to a whole lot of sessions normally. That being said, it is difficult not to get excited about Recipes and this session was exactly what I was hoping for.

Most "It's about time" thing: Randy Fay winning the Aaron Winborn Award.

Most fulfilling personal moment: The DrupalEasy Learning Community alumni and mentor lunch. Having so many of our graduates and mentors in one place was quite gratifying, even if they did turn teasing me into a competitive sport. 

Image removed.

Most of the alumni present were from our long-running 12-week, best practice and beginner focused Drupal Career Online http://drupaleasy.com/dco (next semester begins August 28.)

Best official/unofficial party: The Lullabot Party. There are a few things I really need at a party these days: a volume level where I don't have to scream to have a conversation, an outdoor area, activities, and good food and drink. This one was 4-for-4. The Pins x Pints Barcade Bash from Acquia came in a close second.

Favorite session that I didn't see in person but have since watched: Advanced Render Cache Debugging presented by Jody Hamilton and Janez Urevc. I'll watch pretty much anything having to do with Drupal caching, and this was one of the better presentations I've ever seen on the topic. Well worth your time.

Most useful thing that I really liked but probably not too many other people did: The distance between the expo hall and the session rooms.

Biggest question I left with: Which hosting companies are going to step up and fully support (and promote) hosting plans for Automatic Updates (and therefore Project Browser) for less technical Drupal site-builders?

Best new "thing": I am not a fan of draws (even though I do love soccer,) but in this case I really can't pick one. Both Pitch-burg and the Drupal Association Member Breakfast were fantastic additions this year. I love incentivizing folks to join the Drupal Association (especially with free food.) Also, I was a bit skeptical of Pitch-burg at first, but I really enjoyed how Dries weaved it into his keynote, and I am really looking forward to seeing how the funded projects turn out.

Best contributed module release that took place during DrupalCon: Smart Trim 2.1.0

Biggest complaint: Why was the Single Directory Components session in such a small room? Silly.

Worst accommodations: Mine (shared with Gwendolyn, Sara, John, and Ryan.) We were in an Airbnb that was located by itself in the middle of a mostly-abandoned, overgrown industrial park. We had difficulty getting ride-share drivers there after dark. Seriously. Perhaps we need to read the reviews more carefully next time.

Image removed.

Biggest personal takeaways: Single Directory Components and Recipes are the future of Drupal. Also, the average age of community members needs to get younger (no offense, REDACTED.)

Best completely unofficial social event: The Pirates/A's baseball game on Wednesday afternoon (that led into Wednesday evening.)

Image removed.

Most inconvenient alarm: Thursday, 5am, in the bedroom of our sketchy Airbnb so I could finish prep for the Intro to Module Development workshop I was teaching at 9am.

Favorite image from another DrupalCon Pittsburgh wrap-up blog post: Ted Bowman (T-Bone to his friends) shot-gunning a beer(?) on the keynote stage on Mike Herchel's blog

Tag1 Consulting: My First Drupal Migration

My first Drupal migration was onto a heavily patched version of Drupal 4.0, back in 2002. I previously ran a popular kernel development blog called KernelTrap, using PHPNuke . I conducted interviews with prominent kernel developers , and posted blog entries about other interesting kernel news, all of which were frequently linked to from the front page of Slashdot (the leading tech news aggregator at the time). This resulted in huge traffic spikes, which would frequently bring the website down , commonly known as " the Slashdot effect ”. In early March of 2002, I received a friendly email from a Belgian developer named Dries Buytaert about a relatively new CMS called Drupal. He told me the CMS would be gaining a near magical-sounding performance-feature called "the page cache," which allowed an entire page to be served out of the database with only a single query, theoretically making Drupal able to withstand even a Slashdotting. During his 2015 keynote at DrupalCon Los Angeles , Dries explained that before starting Drupal, he was following Linux kernel development, "I considered contributing to the Linux kernel and so I would follow a website called KernelTrap. KernelTrap was managed by Jeremy Andrews, and at... Read more Jeremy Tue, 10/10/2023 - 07:10

Tag1 Consulting: Gander: The Future of Drupal Performance and Scalability

In a digital era where website performance dictates user experience - directly influencing site success metrics like page views and time on site - the Drupal community has worked tirelessly to make Drupal’s performance best-in-class. Now, as a result of an ongoing collaboration between the Google Chrome team and Tag1 Consulting, Drupal’s performance and scalability are getting a major boost. We are excited to announce a new open source automated performance testing framework, designed and led by Drupal core release and framework manager Nathaniel Catchpole - catch. The system will greatly benefit the development of the Drupal platform itself and, as an open-source tool, enable end-users of Drupal to integrate performance testing into their DevOps toolchain, delivering a substantial competitive advantage to sites powered by Drupal. Want to learn more? Join us at DrupalCon Lille! Performance is a core part of our ethos at Tag1. Our senior team members led the creation of, and maintain most of Drupal's performance and scalability capabilities. We are often hired by our clients (such as Renesas, Sumitomo, US Department of Energy, …) to audit the performance of their websites and help...

Read more janez Mon, 10/09/2023 - 15:39

Specbee: When ChatGPT Meets Drupal: The Future of Intelligent Websites

Unless you have been exceptionally out of touch with current events lately, there’s a good chance you have heard about ChatGPT. Since it was released by OpenAI last year, it has taken the world by storm. ChatGPT is a conversational AI tool, where we can throw a question at it and it answers. At the moment, it's all the rage, and it's being used in a variety of ways. Regardless of your personal stance, we are witnessing a huge change in technology from an AI perspective. The way end users get used to it might change with time from here on. ChatGPT is one major breakthrough or the first time in the AI world where a human-like interaction is possible. This will only keep getting better. There are multiple module projects being implemented in the Drupal contrib space for integrating ChatGPT technology. In this article, let’s take you through one such Drupal module today: OpenAI / ChatGPT / AI Search Integration. Before we dive into the module, let us understand something about OpenAI. What is OpenAI OpenAI is a research lab based out in California and it focuses on developing AI and finding ways to make AI useful in our everyday lives. Apart from exploring AI technologies, OpenAI provides an API to interact with their software. Integrating with a good API has become relatively easy in Drupal in 8/9/10 versions. Before we get into the module, you will need to register on the OpenAI site, create a secret key, and get yourselves ready to use the Drupal module. Here’s a short and straightforward video to help you get started with this. Integrating with the Drupal OpenAI / ChatGPT / AI Search Module This is one of the contributed modules that bring ChatGPT’s capabilities into Drupal. The OpenAI/ChatGPT/AI Search Integration module is compatible with only Drupal 10 and only has an alpha release right now. We can install this module using Composer. composer require 'drupal/openai:^1.0@alpha' The module consists of 9 submodules which provide different functionalities. To mention a few:•    ChatGPT/Prompt explorer•    Content Tools•    CKEditor integration•    Log analyzer•    Text Embeddings We will be dealing with the functionalities that are involved with content generation and manipulation in this blog. 1. Setting up→ For setting up the module, please create an account on the OpenAI website. → Create a secret key.→ Make sure to copy the Organization ID as well. → Finally, enter the values in the OpenAI settings from the Drupal admin. Image: OpenAI settings interface from Drupal setup 2.    ChatGPT/Prompt Explorer→ ChatGPT/Prompt Explorer enables administrators to experiment with the OpenAI services→ These work exactly like ChatGPT, where you will have a textbox for asking a question, and the answer is received in a response in another textbox.→ Apart from this, you will have different form options like model, max tokens, and temperature. Using these options, a user will have different responses. GIF: ChatGPT/Prompt Explorer 3.    CKEditor→ This is the most important implementation of this module.→ There is a CKEditor button provided which lets you ask OpenAI ChatGPT a question and retrieve a text response.→ The button must be enabled from the “Text format and editor” settings.→ Apart from content generation, you also have a few other functionalities such as Summarizing, Translating, Adjusting content tone, and Correcting faulty HTML.→ Every function sends a question to ChatGPT and receives a response back.   Image: Pull the button to active toolbar option in Text format settings. Image: Enable the option from Text Format Settings. Image: CKEditor settings from article content type 4.    Content Tools→ The Content Tools functionalities are very similar to CKEditor ChatGPT.→ With this module, the ChatGPT functionality is available for all the entity forms.→ The difference between CKEditor and Content Tools functionality is that we can use any field to generate a response.   Image: Content Tools options on node form. Image: Content Tools options on node form. 5.    Log Analyzer→This functionality adds an extra message to Drupal’s logging system.→The logger messages sometimes are easily understandable for developers with less or no experience.→OpenAI adds a very generic simple message explaining that error in a simple way Image: Logger Analysis Final Thoughts As we have seen, the OpenAI ChatGPT module provides various functionalities that bring AI capabilities into Drupal. Also, there are enhancements that can improve this module and add some more new features. There are similar other modules that provide similar functionality in different ways. That being said, the OpenAI ChatGPT must be used with a lot of caution and content has to be verified before we publish it as this is machine-generated content. We must handle the content responsibly and refrain from sharing sensitive information while interacting with ChatGPT or any similar AI tools. Explore our Drupal Services for innovative web experiences. Let's build forward together!  

Talking Drupal: Talking Drupal #419 - Drupal 7 EOL & Backdrop CMS

Today we are talking about Drupal 7 EOL, Backdrop CMS, and Upgrade strategy from Drupal 7 with guests Jen Lampton & Laryn Kragt Bakker. We’ll also cover Acquia Migrate: Accelerate as our module of the week.

For show notes visit: www.talkingDrupal.com/419

Topics
  • When is Drupal 7 EoL
  • If someone is on Drupal 7 what are their options
  • If someone does not have the resources to upgrade to Drupal 10 what can they do
  • Can someone stay on Drupal 7 after EoL
  • What is Backdrop CMS
  • Listener question - James: Some people have mentioned that Backdrop has changed significantly since forking, does this affect upgrading from drupal 7
  • Listener question - James: Will there be another fork
  • How can Backdrop help people get off of Drupal 7
  • Tell us a bit about Backdrop’s annual online event
  • Is Backdrop negatively affecting Drupal 10 adoption
  • How does someone get involved with Backdrop
  • What are some big features on the Backdrop roadmap
Resources Guests

Laryn Kragt Bakker - atendesigngroup.com - laryn

Hosts

Nic Laflin - nLighteneddevelopment.com nicxvan John Picozzi - epam.com johnpicozzi Jen Lampton - jenlampton.com - jenlampton

MOTW Correspondent

Martin Anderson-Clutz - @mandclu Acquia Migrate: Accelerate

  • Brief description:
    • Have you ever wanted to add a layer of automation to Drupal’s migrate API, to simplify the process of migrating content and site architecture from Drupal 7 to Drupal 9? There’s a module for that.
  • Brief history
    • How old: created in July 2020 by Aaron Winborn-award winner webchick
  • Versions available:
    • 1.8.0 release which works with Drupal 9
  • Maintainership
    • Actively maintained - latest release, its first as open source, was in the last week
  • Number of open issues:
    • 3 issues, none of which are bugs, and all labeled as fixed
  • Usage stats:
    • None, officially
  • Maintainer(s):
    • Current release by Wim Leers, a longtime Drupal contributor and core subsystem maintainer
  • Module features and usage
    • The goal of Migrate Accelerate is to make Drupal core’s migrate API something that can be used by less technical users to migrate a Drupal 7 site to a modern version of Drupal
    • Relies on an Acquia CLI command to analyze your Drupal 7 site, so it can generate a composer.json file using an existing matrix of hundreds mappings from legacy modules to modern Drupal equivalents, including patches
    • That composer file becomes the basis for your migrated site, into which it will begin to migrate your content architecture
    • It provides a dashboard that lists out the various kinds of content found on the origin site, with an ability to control the order in which the migrations will be performed
    • At any point it’s possible to see a live preview the content that’s been migrated, within the same UI
    • There’s also a drush command to trigger the same process, which actually runs more efficiently but still allows for live preview
    • If you want to get an estimate on how much of your Drupal 7 site can be migrated automatically, there is also a Flightpath report you can generate (using a drush command) which is an HTML file that summarizes how much of your Drupal 7 site can be migrated automatically
    • Migrate Accelerate used to be available only to Acquia customers and partners, but with this new release anyone in the community can use it to help them migrate their Drupal 7 site forward

The Drop Times: Write, Erase, Rewrite and Repeat

Dear Readers,

In all its forms, writing often appears as a daunting task, a paradox of creativity and precision that demands perseverance and hope. Moving pen against a piece of paper or fingers over a keyboard requires an unshakeable commitment to bringing forth thoughts and ideas, whether they emerge as authentic expressions or mechanical arrangements of words.

In the timeless verses penned by Katsushika Hokusai, we are privy to the gentle whisper of creativity's muse:

"I write, erase, rewrite 
Erase again, and then 
A poppy blooms."

—Katsushika Hokusai, A Poppy Blooms

These lines serve as a poignant reflection of the creative journey, where the path to brilliance is often obscured by layers of revisions and rewrites. Indeed, I am no stranger to the backspace key, a constant companion in crafting this very newsletter. Much like the poppy that buds and withers before its triumphant bloom, we, as writers, are bound by the intrinsic human inclination to err yet also to redeem ourselves through the transformative acts of erasing and rewriting. In this very process, the metaphorical poppies of our creativity ultimately flourish.

But what of the Drupal community, you may ask? When change is the only constant, the Drupal community is much like the poppy described in Hokusai's haiku. It, too, experiences its cycles of growth, refinement, and blossoming. The collaborative efforts of developers, designers, and enthusiasts mirror the writer's journey of writing, erasing, and rewriting, with each iteration bringing Drupal closer to its full potential.

In this delicate dance of imperfection and aspiration, we embark on a voyage through the intricate realms of writing—a journey replete with missteps, yet one that, through tenacity and determination, yields the exquisite blossoming of ideas, narratives, and the quintessence of human expression. It is a journey where every word, every stroke, and every backspace key press leads us closer to realising our creative aspirations, each revision chiselling our narrative until it shines its brightest, much like the Drupal community itself, where innovation and collaboration, the act of writing, erasing, and rewriting is an artistry that blooms with the promise of continuous growth and transformation.

In the past week, The DropTimes published an interview with Sven Schüring, a distinguished consultant in KRZN, known for his expertise and unwavering advocacy of open-source principles and web accessibility. Engaging in a profound conversation with Thomas Alias K, a former sub-editor at TDT, Sven delved deep into the imperative of demystifying the web development culture from 'them' to 'us'.

On our constant quest to find the greatness of Drupal, I sought the expertise of Italo Mairo, a prominent contributor to Drupal's GIS module habitat. Together, we compiled a comprehensive list of Geographic Information System (GIS) modules available within the Drupal framework, further enriching our readers' knowledge.

In the realm of digital innovation, NETNODE AG, a Swiss-based digital agency renowned for its prowess in Drupal and NextJS development, introduced NodeHive—a pioneering, eco-conscious headless Content Management System (CMS) tailored to organisations committed to sustainability and innovation. In a stimulating conversation, Lukas Fischer, Founder and Product Steward of NodeHive, shared insights with me about their journey towards a sustainable and greener digital future.

Drupal enthusiasts take note of the upcoming DrupalCon Lille, a mere two weeks away! The event's website now features an extensive list of accommodations to ensure a comfortable experience for all attendees. Meanwhile, DrupalCon Portland 2024 has commenced its Call for Papers, and registration for Drupal GovCon 2023 in Bethesda is now open. The New England DrupalCamp has unveiled its session agenda, promising knowledge-sharing opportunities. TDT has also compiled a list of events within the Drupal Community for the week.

In recognition of excellence, the Acquia Engage Awards 2023 has unveiled its list of finalists, selected from an impressive pool of 85 entries. Acquia has also released an e-book, "Setting The Record Straight on Drupal Myths," promising to debunk common misconceptions surrounding the platform. Furthermore, the transformative impact of LocalGov Drupal Microsites on the digital outlook of UK Councils is worth celebrating.

amazee.io has recently announced a strategic partnership with Tag1 Consulting, Inc., marking a significant development in the industry. Meanwhile, Swiss Splash Awards has returned triumphantly after a three-year hiatus, and Unic's Graubuenden.ch swept the accolades. The latest API Resilience podcast episode explored Composable Web with John Doyle and Henk Beld.

In a substantial regulatory update, the latest iteration of the European Accessibility Act (EAA) will introduce stricter accessibility requirements for digital products, focusing on websites. This landmark regulation is scheduled to come into effect on June 28, 2025, emphasising the growing importance of web accessibility.

LN Webworks generously shared ten vital tips for Drupal site maintenance in a recent article, offering practical guidance to website administrators. Furthermore, cmsMinds has undertaken the task of demystifying the intricate Drupal domain, providing an extensive guide that elucidates 16 essential Drupal terms, their significance, real-world applications, and best practices.

Exploring the role of Drupal as a Content Management System (CMS) in the education sector, Anastasia Rats authored an article published by Five Jars. Similarly, LN Webworks delves into the compelling reasons behind Drupal's popularity among higher education institutions, shedding light on its suitability for their unique needs.

That concludes the highlights of the week's developments in Drupal. Let us collectively celebrate the continued growth and innovation within this thriving community.

Sincerely, 
Alka Elizabeth 
Sub-editor, The DropTimes

Metadrop: Drupal Updater: Streamlining Drupal Maintenance Updates from CLI

Drupal, a powerful content management system, relies on a multi-component ecosystem comprising Drupal modules, themes, vendor packages, and external libraries. Regular updates are essential to keep your Drupal project secure, efficient, and equipped with the latest features. However, managing these updates manually can be time-consuming and error-prone.

The update process typically involves package updates, thorough testing (both automated and manual), and ensuring stability. Automating this process can alleviate the burden of manual labor and allow teams to focus on critical tasks. Furthermore, having a standardized update procedure ensures consistency across the development team.

Additionally, in Drupal, individual modules may introduce configuration changes, making it crucial to isolate these changes in separate commits, combining package updates with the associated configuration. This practice allows for easy rollbacks and commits revert when necessary.

Drupal Updater to the Rescue

The Drupal Updater is a versatile tool compatible with any Drupal 9 and above installation. Its primary function is to detect and update outdated packages listed in the `composer.json` file, along with their associated configuration. 

More info and full documentation on GitHub…

LN Webworks: Drupal BigPipe Module: The Phenomenal to Improve Website Performance

Image removed.

According to intriguing research, pages with a load time of 1 to 2 seconds have the maximum conversion rates, and with every additional second of load time, the conversion rate drops by 4.42%. Surprising. We live in a world where speed is everything. If your website performance cannot meet the expectations of the visitors, the stakes are quite high. So, what can you do to boost website performance? Gladly, there are numerous techniques available and the BigPipe technique is one of them. If your site relies on Drupal, you can install the BigPipe module with incredible Drupal 10 compatibility to leverage the power of this technique. It is interesting to note that the BigPipe technique was initially developed by Facebook but today, a plethora of organizations are utilizing it across the globe.