Specbee: Style Made Simple with Acquia Site Studio’s Style Guide Manager
Web Wash: Getting Started with Webform in Drupal (2024)
Webform is a Drupal module that allows you to create forms directly in Drupal without using a 3rd party service.
It can be used to create basic “Contact Us” and complex application forms with custom field logic and integration.
In this getting started guide you’ll learn how to:
- Create a form
- Add elements to form
- Customize form with conditional logic
- Embed the form
- Send submissions to Google Sheets
This tutorial accompanies the video above.
Factorial.io: A weekend dedicated to Drupal CMS
For years, the last weekend in January has been a special one for the worldwide community behind the CMS system Drupal: The Global Contribution Weekend. Factorial has been a major contributor to the Drupal community for many years, so we hosted our own hybrid Global Contribution Weekend event.
DrupalEasy: DrupalEasy Podcast S16E4 - Kevin Quillen - Drupal 10 Development Cookbook
We talk with Kevin Quillen, author of Drupal 10 Development Cookbook, published in February, 2023 by Packt Publishing.
URLs mentioned- Drupal 10 Development Cookbook
- Open AI / ChatGPT integration module
- Velir
- Kevin's blog
- Drupal Test Traits
- Drush's generate command
Professional module development - 15 weeks, 90 hours, live, online course.
Drupal Career Online - 12 weeks, 77 hours, live online, beginner-focused course.
We're using the machine-driven Amazon Transcribe service to provide an audio transcript of this episode.
SubscribeSubscribe to our podcast on iTunes, Google Play, iHeart, Amazon, YouTube, or Spotify.
If you'd like to leave us a voicemail, call 321-396-2340. Please keep in mind that we might play your voicemail during one of our future podcasts. Feel free to call in with suggestions, rants, questions, or corrections. If you'd rather just send us an email, please use our contact page.
CreditsPodcast edited by Amelia Anello.
DrupalEasy: Debugging all the things with Xdebug, DDEV, PhpStorm, PhpUnit
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 setupI 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 solutionThis 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…
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.
PreviousNext: Automatic message scheduling and replacing hook_cron
Symfony Scheduler provides a viable replacement to hook_cron wherein messages can be scheduled for dispatch at a predefined interval. Messages are dispatched the moment they are scheduled, and there is no message duplication, making tasks more reliable and efficient.
by daniel.phin / 6 February 2024This post is part 4 in a series about Symfony Messenger.
- Introducing Symfony Messenger integrations with Drupal
- Symfony Messenger’ message and message handlers, and comparison with @QueueWorker
- Real-time: Symfony Messenger’ Consume command and prioritised messages
- Automatic message scheduling and replacing hook_cron
- Adding real-time processing to QueueWorker plugins
- Making Symfony Mailer asynchronous: integration with Symfony Messenger
- Displaying notifications when Symfony Messenger messages are processed
- Future of Symfony Messenger in Drupal
With this, the sm worker provided by the SM project, the Symfony Messenger integration with Drupal, can be solely relied on. Rather than legacy runners such as Drupal web cron, request termination cron (automated_cron.module), Drush cron, and Ultimate Cron.
Scheduler functionality is implemented by the Symfony Scheduler component. The Drupal integration is provided by the SM Scheduler module
Schedule providerCreate a message and message handler as usual, then create a Schedule Provider:
<?php declare(strict_types = 1); namespace Drupal\my_module\Messenger; use Symfony\Component\Scheduler\Attribute\AsSchedule; use Symfony\Component\Scheduler\RecurringMessage; use Symfony\Component\Scheduler\Schedule; use Symfony\Component\Scheduler\ScheduleProviderInterface; #[AsSchedule('my_scheduler_name')] final class MyScheduleProvider implements ScheduleProviderInterface { /** * {@inheritdoc} */ public function getSchedule(): Schedule { return (new Schedule())->add( RecurringMessage::every('5 minutes', new MyMessage()), ); } }A schedule provider is:
- a class at the Messenger\ namespace
- with a #[AsScheduler] class attribute
- implementing \Symfony\Component\Scheduler\ScheduleProviderInterface
- implements an getSchedule method. This method returns a message instance and the schedule frequency.
For dependency injection, schedule providers have autowiring enabled.
What would normally be the contents of a hook_cron hook would instead be added to the message handler. The message itself does not need to store any meaningful data.
Instead of intervals via RecurringMessage::every(...), crontab syntax can be used:
\Symfony\Component\Scheduler\RecurringMessage::cron('*/5 * * * *', new MyMessage());Running the workerLastly, schedulers must be run via the consume command with a dedicated transport. The transport name is the schedule ID prefixed by scheduler_. For example, given the scheduler ID my_scheduler_name from above, the transport name will be scheduler_my_scheduler_name.
The command finally becomes: sm messenger:consume scheduler_my_scheduler_name .
TimingMessages will be dispatched the moment their interval arrives. Normally intervals begin when the worker is initiated, however you can set a point in time to begin interval computation using the \Symfony\Component\Scheduler\RecurringMessage::every $from parameter.
The worker must be running at the time when a message is scheduled to be sent. The transport won't retroactively catch-up with messages not dispatched during the time it wasn't running.
The next post outlines how to intercept legacy Drupal @QueueWorker items and insert them into the message bus.
Tagged Symfony, Symfony Messenger, Symfony Scheduler, CronTalking Drupal: Talking Drupal #436 - Drupal & AI
Today we are talking about AI within Drupal, How AI can help, and Modules to use with guest Martin Anderson-Clutz. We’ll also cover Augmentor AI as our module of the week.
For show notes visit: www.talkingDrupal.com/436
Topics- Terminology
- IMF analysis
- Prompt engineering
- AI in Drupal
- Best way to try modules
- Best use of AI
- Other ways of integrating
- Augmentor AI
- Open AI
- Prompt Engineering: Get the Most From Your Drupal Site's AI Integration
- Terminology
- NLP - work with text provided in a conversational format, understand the intended meaning, and provide a relevant response
- AI - A subset of CS that aims to develop systems that can mimic human response, or automating sophisticated behavior
- ML - subset of AI that aims to act without explicit guidance, by extrapolating from known data
- Deep learning - a subset of ML which uses artificial neural networks with representational learning to develop and leverage their own means of classification and other feature detection
- LLM - an AI algorithm that uses Deep Learning techniques to accomplish NLP tasks such as responding to unstructured user prompts. LLMs are trained on massive data sets, often gathered from the internet, but sometimes using more specialized data
- Typically the AI interfaces our listeners are already using are based on an LLM, but the nature and recency of the data they’ve been trained on can vary widely. Recently Mike Miles created Drupal Droid, a GPT model specifically trained for Drupal developers, and you can find a demo of that in our YouTube channel
- Mike Miles Drupal Droid
- AI module list
- OpenAI Image
- Search API Pinecone
- TMGMT Translator OpenAI
Martin Anderson-Clutz - mandclu
HostsNic Laflin - nLighteneddevelopment.com nicxvan John Picozzi - epam.com johnpicozzi
MOTW CorrespondentMartin Anderson-Clutz - mandclu Augmentor AI
- Brief description:
- Have you ever wanted a highly configurable way to integrate multiple AI services with your Drupal site? There’s a module for that.
- Brief history
- How old: created in Oct 2022 by murrayw of Morpht, though recent releases are by elonel
- Versions available: 1.1.2 which works with Drupal 9.5 and 10
- Maintainership
- Actively maintained, most recent release was earlier this month
- Documentation available
- Number of open issues: 11, 3 of which are bugs
- Usage stats:
- 82 sites
- Module features and usage
- To use Augmentor AI, you need to define one or more “augmentor” configuration entities. An augmenter entity implements an augmentor type, which determines what AI service it can use, what configuration options it will have available, and so on.
- The augmentor will define one or more “messages” that provide structure to the prompt that will be passed to the AI model in order to generate a response. It can also be configured in a variety of ways, such as how much randomness to use, a maximum response length, and more.
- You can expose your augmentor(s) to content creators by adding a CKEditor button, or by adding fields to your site’s entity forms. For each field use can choose the widget to use, and how it should interact with any existing data in the field you want to target.
- For example, you could have it generate a summary from your body field and have it automatically populate the summary field. Or, you can have it suggest tags, but the specialized widget renders each suggestion as a clickable element that will add the tag to a core tag field.
- There are currently modules available to integrate Augmentor AI with ChatGPT, Google Cloud Vision, AWS AI, and more.