Übersicht

Vorschläge max.2 pro Tag

Platz für Vorschläge, Fragen, Anderes

Wenn sie Antworten erhalten wollen tragen sie hier Kontaktdaten wie email-Adresse oder Telefonnummer oder Postanschrift ein

CAPTCHA
Sicherheitscheck: Tragen sie die abgebildeten Buchstaben und/oder Zahlen hier unter in das freie Feld ein.
Image CAPTCHA
Enter the characters shown in the image.

Linux - here we go

Umfrage

Wie gefällt euch/ihnen diese Seite:

Vorschläge und Wünsche bitte an: support@webjoke.de.

Benutzeranmeldung

CAPTCHA
Sicherheitscheck: Tragen sie die abgebildeten Buchstaben und/oder Zahlen hier unter in das freie Feld ein.
Image CAPTCHA
Enter the characters shown in the image.

Specbee: Hooks or Events? Choosing the Best Approach for your Drupal Project

Drupal News - Di, 03/19/2024 - 07:57
For Drupal developers, it's crucial to understand two fundamental concepts: Events and Hooks. Why? Because they’re the most powerful ways to enable customization and extensibility in Drupal. An event is a system or module-generated occurrence that triggers specific actions, while a hook is a callback function that allows developers to interact with, modify, or extend the behavior of a Drupal core or any module. Ready to learn more about each of them and find out how they’re different in their roles and usage in Drupal development? Dive in! What are Events in Drupal Events are just like hooks that tell Drupal to call your function if something happens. We can say Events are Object Oriented Hook System. Drupal Events allow various system components to interact and communicate with one another independently or in a decoupled manner. Characteristics Events are part of Drupal's broader adoption of the Symfony framework. Events are dispatched by certain actions or triggers within the system. You can dispatch events while writing custom code in order to notify other components in the system about actions taken by your code. Developers can subscribe to these events and define custom actions to be executed when the event occurs. Example Drupal core event: KernelEvents::REQUEST Scenario: Implementing a custom module that listens to the REQUEST event to perform specific actions before the request is processed. // MyModuleEventSubscriber.php namespace Drupal\my_module\EventSubscriber; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\Event\RequestEvent; class MyModuleEventSubscriber implements EventSubscriberInterface {   public static function getSubscribedEvents() {     $events[KernelEvents::REQUEST][] = ['onRequestEvent'];     return $events;   }   public function onRequestEvent(RequestEvent $event) {     // Custom logic to be executed on every request.   } }Discover Existing Events There are different methods for finding existing events: 1. Using the WebProfiler module: Download and enable WebProfiler and Devel module since WebProfiler depends on the Devel module Then navigate to Manage > Configuration > Devel Settings > WebProfiler and then select the checkbox to activate the “Events” toolbar item. Now while you visit any page on your site you should see the WebProfiler toolbar at the bottom of the page, and after clicking on the events toolbar icon you will get a list of all event subscribers and information that are called during that request. 2. Use Devel to view and event class: drush devel:event  Enter the number for which you want to get information.:   [0] kernel.controller   [1] kernel.exception   [2] kernel.request   [3] kernel.response   [4] kernel.terminate   [5] kernel.view  > 0  Enter the number to view the implementation.:   [0] Drupal\path_alias\EventSubscriber\PathAliasSubscriber::onKernelController   [1] Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::onController   [2] Drupal\webprofiler\DataCollector\RequestDataCollector::onKernelController  > 03. Search in your codebase for @Event:  In your editor such as Visual Studio or PHPStorm, search for text @Event within the file mask: *.php option. Subscribe to an Event As we know Drupal uses an event–driven architecture, where various components can communicate with each other by dispatching and subscribing to Events. Here is an example of subscribing to an Event in Drupal 9/10. 1. Define and Event subscriber service  # MyModule/my_module.services.yml services:   my_module.event_subscriber:     class: Drupal\my_module\EventSubscriber\MyModuleEventSubscriber     tags:       - { name: event_subscriber }2. Define an Event subscriber class // MyModule/src/EventSubscriber/MyModuleEventSubscriber.php namespace Drupal\my_module\EventSubscriber; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\Event; /** * Class MyModuleEventSubscriber. */ class MyModuleEventSubscriber implements EventSubscriberInterface {   /**   * {@inheritdoc}   */   public static function getSubscribedEvents() {     // Specify the event(s) to subscribe to and the method to call when the event occurs.     $events = [       'node.insert' => 'onNodeInsert',       'user.login' => 'onUserLogin',     ];     return $events;   }   /**   * React to a node insert event.   */   public function onNodeInsert(Event $event) {     // Your logic here.     \Drupal::logger('my_module')->notice('Node inserted!');   }   /**   * React to a user login event.   */   public function onUserLogin(Event $event) {     // Your logic here.     \Drupal::logger('my_module')->notice('User logged in!');   } }In this example: MyModuleEventSubscriber is a class that implements the EventSubscriberInterface. The getSubscribedEvents method specifies which events the subscriber is interested in and which method to call when each event occurs. The onNodeInsert and onUserLogin methods contain the logic you want to execute when the corresponding events occur. Dispatch an Event In order to allow another developer to subscribe to the Events and react accordingly, you can dispatch an event within your modules or submodules. Before dispatching an Event we need to understand when to dispatch an event. You can dispatch an event if you want to extend your logic without updating your existing code. Events can be dispatched at any time like creating, updating, loading or deleting data managed by your module. Lets explain this with an example. Take a scenario where we want other developers to interact when a new entity (taking node here) is created after submitting your custom form. 1. Create a custom module (if don’t have): # Create the module directory mkdir modules/custom/custom_logger # Create the module file touch modules/custom/custom_logger/custom_logger.info.yml2. In custom_logger.info.yml, add the following content: name: 'Custom Logger' type: module description: 'Custom module for logging events.' core_version_requirement: ^8 || ^9 || ^10 package: Custom3. Create an Event: // modules/custom/custom_logger/src/Event/CustomLoggerEvent.php namespace Drupal\custom_logger\Event; use Symfony\Component\EventDispatcher\Event; /** * Defines the custom event for the custom_logger module. */ class CustomLoggerEvent extends Event {   /**   * The node that triggered the event.   *   * @var \Drupal\node\Entity\Node   */   protected $node;   /**   * CustomLoggerEvent constructor.   *   * @param \Drupal\node\Entity\Node $node   *   The node that triggered the event.   */   public function __construct($node) {     $this->node = $node;   }   /**   * Get the node object.   *   * @return \Drupal\node\Entity\Node   *   The node.   */   public function getNode() {     return $this->node;   } }4. Dispatch the Event: Creating any entity (taking node here) and dispatching a custom event with a created entity (node) as a parameter. // modules/custom/custom_logger/src/Form/MyCustomForm.php namespace Drupal\custom_logger\Form; use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\custom_logger\Event\CustomLoggerEvent; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; /** * My custom form. */ class MyCustomForm extends FormBase {   /**   * The event dispatcher service.   *   * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface   */   protected $eventDispatcher;   /**   * Constructs a new MyCustomForm object.   *   * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher   *   The event dispatcher service.   */   public function __construct(EventDispatcherInterface $event_dispatcher) {     $this->eventDispatcher = $event_dispatcher;   }   /**   * {@inheritdoc}   */   public static function create(ContainerInterface $container) {     return new static(       $container->get('event_dispatcher')     );   }   /**   * {@inheritdoc}   */   public function getFormId() {     return 'my_custom_form';   }   /**   * {@inheritdoc}   */   public function buildForm(array $form, FormStateInterface $form_state) {     // Build your form elements here.     return $form;   }   /**   * {@inheritdoc}   */   public function submitForm(array &$form, FormStateInterface $form_state) {     // Process form submission and create a new node.     // ...     // Dispatch the custom event.     $node = $this->getCreatedNode(); // Implement this method based on your use case.     $event = new CustomLoggerEvent($node);     $this->eventDispatcher->dispatch('custom_logger.event', $event);     // Perform any additional actions after the event is dispatched.   } }5. React to Event: Now other modules or parts of the application can now subscribe to the custom_logger.event with the created node as a parameter. What are Hooks in Drupal Hooks allow modules to alter and extend the existing behavior of Drupal Core or any other module without modifying existing code. Read about update and post update hooks to update your Drupal site in this article. Characteristics Drupal's traditional way of allowing modules to interact with the system. Code can be improved or modified independently and incrementally. Hooks are predefined functions with specific names that Drupal core or modules call at various points during execution. Developers implement these functions in their modules to extend or alter default behavior. Very efficient and easy to implement. Types of Hooks Hooks that react to events: like when the user gets logged in and some action needs to be performed. This is very similar to Events. This is invoked when specific actions are performed. For example hook_user_cancel(). Hooks that answer questions: like “info hooks”. These are invoked when some component is gathering information about a particular topic. These hooks return arrays whose structure and values are determined in the hook definition. For example, see user module hook user_toolbar() that adds links to the common user account page to the Toolbar. Note: In  Drupal 8 or further versions this is generally handled by the plugin system. Therefore there are very few hooks present now than in Drupal 7. Hooks that alter existing data: Alter hooks are generally suffixed with alter. These are invoked to allow modules to alter the existing code. For example: hook_form_alter(). Example: Drupal core hook: hook_form_alter() Scenario: Modifying a form defined by another module. // my_module.module function my_module_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {   // Custom logic to alter the form. }Discover existing Hooks Hooks can be defined by any of contrib or custom modules, even though there are some hooks invoked by Drupal core subsystems like Form API that are always present. This can be a little tricky sometime to find out what hooks are available and which ones to implement. There are different ways to discover existing hooks: Look for the hook definitions in *.api.php files contained either in Drupal core or any contributed modules. You can use your IDE to search for functions whose name starts with hook_. You can get a complete list of hooks here. Another way is to use drush command that will five you a list of all implementations of a specific hook. drush fn-hook help #Alias of drush devel:hookInvoke a New Hook To allow other developers to modify or extends our feature you should invoke a hook or alternatively dispatch an event. This can be done on any action like creating, deleting, updating or event when we receive or push some data through API. Hooks are invoked using the module_handler \Drupal::moduleHandler() services. Hooks can be invoked in different ways: Execute the hook in every module that implements it: ModuleHandler::invokeAll() Execute the hook per-module, usually by looping over a list of enabled modules: ModuleHandler::invoke() Call an alter allowing for alteration of existing data structures using ModuleHandler::alter(). Define a new hook To define a new hook you should do the following: 1. Choose a unique name for your hook 2. Document your hook Hooks are documented in a {MODULE_NAME}.api.php file: // custom_hooks.api.php /** * Define a custom hook for reacting to specific events. * * This hook is invoked when a certain event occurs in the system. * Modules can implement this hook to perform additional actions in response to the event. * * @param string $param1 *   An example parameter for the hook. * @param array $param2 *   Another example parameter for the hook. * * @ingroup custom_hooks_hooks */ function hook_custom_event($param1, array $param2) {   // Your custom hook logic here. }3. Invoking your hook in your module’s code: /** * Implements hook_ENTITY_TYPE_view(). */ function hooks_example_node_view(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display, $view_mode) {   // Invoke a hook to alert other modules that the count was updated.   $module_handler = \Drupal::moduleHandler();   // In this example we're invoking hook_custom_event()             $module_handler->invokeAll('custom_event', [$entity]); }When to Use Events or Hooks Events: Prefer events when actions need to be decoupled or when integrating with Symfony components. Hooks: Use hooks for more straightforward modifications or when interacting with the Drupal core and contributed modules. Pros and Cons of using Events VS Hooks Events: Pros: Decoupling, better organization, and Symfony integration. Cons: Slightly steeper learning curve for those unfamiliar with Symfony. Hooks: Pros: Simplicity, well-established in Drupal, easier for Drupal – specific tasks. Cons: Tighter coupling, less organization in larger projects. Final Thoughts Understanding Events and Hooks is extremely crucial for effective Drupal development. While hooks are traditional Drupal mechanisms for extending functionality, events have been introduced since Drupal 8 as part of it’s event-driven architecture. Choosing the right mechanism should be based on the complexity and nature of the Drupal project. Got a Drupal project in mind that requires a 100% Drupal-focused expertise? We’d love to talk to you!
Kategorien: Drupal News

Acquia Developer Portal Blog: DevOps: The Gravity of the Modern Web Cosmos

Drupal News - Di, 03/19/2024 - 00:59

Some of the illustrations in this article are created by: Martin Anderson-Clutz and Thomas Scola.

Kategorien: Drupal News

Talking Drupal: Talking Drupal #442 - Mercury Editor

Drupal News - Mo, 03/18/2024 - 20:00

Today we are talking about Mercury Editor, What it does, and how it could change your editorial life with guest Justin Toupin. We’ll also cover Webform Protected Downloads as our module of the week.

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

Topics
  • What is Mercury Editor
  • What is powering Mercury Editor
  • Do you see any risk building on top of Paragraphs
  • Does Mercury Editor cost anything
  • Can companies hire Aten to add features
  • What are some key features
  • What makes Mercury Editor unique
  • How stable is the content
  • What happens if Paragraphs stops being supported
  • How can the community help
Resources Guests

Justin Toupin - atendesigngroup.com justin2pin

Hosts

Nic Laflin - nLighteneddevelopment.com nicxvan John Picozzi - epam.com johnpicozzi Anna Mykhailova - kalamuna.com amykhailova

MOTW Correspondent

Martin Anderson-Clutz - mandclu

  • Brief description:
    • Have you ever wanted to have downloadable content on your website, only available to visitors who have filled out a webform? There’s a module for that.
  • Module name/project name:
  • Brief history
    • How old: created in Sep 2010 by berliner, but the most recent releases are by james.williams of Computer Minds
    • Versions available: 7.x-1.1 and 8.x-1.0-alpha2 versions available, the latter of which works with Drupal 9 and 10
  • Maintainership
    • Actively maintained, the latest release was a week ago
    • Security coverage
    • Introductory blog linked on the project page
    • Number of open issues: 18 open issues, none of which are bugs against the current branch
  • Usage stats:
    • 804 sites
  • Module features and usage
    • Having thought leadership content like white papers or reports gated behind a lead capture form is a common pattern for websites, and this module is designed to make that easy to set up
    • You use the module by adding a handler to your webform, similar to triggering an email send
    • In the configuration for your webform protected download handler you have options for how much verification you want for the download link, whether or not the link should expire after a period of time, and so on, in addition to uploading one or more files that can be downloaded by people who submit the webform
    • The module provides tokens for the download URLs, so you can easily include them in a submission confirmation message or email
Kategorien: Drupal News

The Drop Times: MidCamp 2024 Innovates with Unconference Format and Training

Drupal News - Mo, 03/18/2024 - 18:44
MidCamp 2024, set to take place at DePaul University, promises innovative formats and a focus shift towards AI, marking a significant evolution in the annual Midwest Drupal Camp's history.
Kategorien: Drupal News

The Drop Times: Tracking Drupal's Global Footprint

Drupal News - Mo, 03/18/2024 - 18:44

Dear Readers,

Drupal has seen widespread adoption worldwide, a testament to its flexibility, security, and scalability. Renowned for its modular architecture and strong community support, Drupal empowers developers, businesses, and governments to create and manage diverse digital experiences. From educational institutions and media outlets to non-profit organizations and governmental agencies, the platform's extensive capabilities allow for the customization and integration necessary to meet complex digital needs.

An endeavor to track Drupal's usage across various industry sectors represents a need of the moment for the Drupal community and is put forth by Paul Johnson. The project aims to showcase Drupal's diverse applicability and strengthen its shared knowledge base by gathering detailed resources and data. This concerted effort, aimed at illuminating Drupal's footprint, will offer insights into the platform's impact and success across different domains. It sets the stage for a deeper understanding of the community's achievements and challenges, guiding them toward more strategic, evidence-based decisions within the digital ecosystem.

The DropTimes [TDT] has already published a comprehensive study on Drupal's usage in prominent educational institutions worldwide, which can set the right example for this new project. Grzegorz Pietrzak's study on global city website trends analysis further underscores Drupal's influence across diverse sectors, amplifying the platform's prominence within various industry verticals. The full study is published on our website; read it here

As the community delves into the specifics of these endeavors and their implications, it is crucial to remain connected and informed. With that, welcome to the last week's most important content covered by The DropTimes.

Performance is the cornerstone of user experience and operational efficiency in web development. Learn about the genesis, capabilities, and transformative potential of Gander, the automated performance testing framework for Drupal, as elucidated by Nathaniel Catchpole and Janez Urevc in Elma John's latest article

We have a new addition to our Spotlights channel, Zoocha, a leading Drupal Development Agency in the UK. The article discusses the intricate world of Zoocha, bringing to light the company's journey, strategies, and outlook with contributions from Will Huggins, the CEO, and the Zoocha team.

Dries Buytaert, the founder of Drupal, visited Japan for the first time in nearly eight years. He presented the latest developments in Drupal and associated web technologies at the Drupal Meetup. Tokyo. Read the article by Kazima Abbas for a comprehensive overview of the Tokyo Meetup and its significance. 

Interestingly, the recent Drupal Meetup, organized by Valuebound in collaboration with the Drupal Association, marked a significant event for Drupal enthusiasts and professionals. The event, held at Valuebound's office in Bangalore, featured a special meet-and-greet session with Tim Doyle, the CEO of the Drupal Association. As an after-note, Tim wrote, that "Drupal is alive and well in India", owing to the enthusiastic Drupal Community in India.

The Drupal Community has many events to celebrate this week, but MidCamp 2024 and DrupalSouth Sydney 2024 tops the list. As the Media Partner for both events, The DropTimes is determined to provide its readers timely updates. A complete list of events for the week is available here.

The upcoming DrupalCamp Burkina Faso 2024 is close to reaching its funding target, needing just $2,000 more to facilitate the largest DrupalCamp event in West Africa.  DrupalCamp Asheville is now open for speaker submissions, inviting seasoned presenters and newcomers to share their expertise and insights. Also, the last chance to submit proposals for Stanford WebCamp 2024 ends on or before March 25, 2024. The DrupalSouth Splash Awards 2024 shortlist, sponsored by Ironstar, has been announced ahead of the event. 

Imre Gmelig Meijling, CEO of React Online Digital Agency in The Netherlands, has been introduced as one of the newest members elected to the Drupal Association Board. Alex Moreno has launched a comprehensive guide to enhance impactful contributions to Drupal and the Drupal Association. The contributor guide lists strategic initiatives, crucial issues, and essential modules, offering contributors an avenue to make significant impacts within the Drupal community.

The Drupal community has recently seen the introduction of a new module, Bill of Lading, created by Jeff Greenberg. This module simplifies site management by generating a comprehensive list of Drupal structures using a new Drush command, 'bol.' QuantCDN co-founder Kristen Pol has announced a major update to their Drupal static site generator, enhancing Drupal 9 and 10 integration with new features, including visibility into Quant metadata directly within the Drupal platform.

We acknowledge that there are more stories to share. However, due to constraints in selection, we must pause further exploration for now.

To get timely updates, follow us on LinkedIn, Twitter and Facebook. Also, join us on Drupal Slack at #thedroptimes.

Thank you,

Sincerely
Alka Elizabeth
Sub-editor, TheDropTimes.

Kategorien: Drupal News

The Drop Times: Drupal Page Builders—Part 1: Paragraph-Based Solutions

Drupal News - Mo, 03/18/2024 - 18:44
Dive into the changing dynamics of Drupal's page-building features with André Angelantoni's new series on The DropTimes. Discover the progression of Drupal's page layout options as the author begins exploring Paragraph-Based Solutions. Gain historical insights, learn about the shift towards Layout Builder, and examine the Paragraphs module and related tools like Layout Paragraphs and Mercury Editor. Anticipate detailed discussions on contributed modules, alternative solutions, and potent distributions in the forthcoming parts of the series. Ideal for developers and content managers seeking to upgrade their Drupal 10+ projects.
Kategorien: Drupal News

Drupal Mountain Camp: Thanks for being a part of Drupal Mountain Camp 2024

Drupal News - Mo, 03/18/2024 - 16:10
Thanks for being a part of Drupal Mountain Camp 2024 admin Mon, 03/18/2024 - 15:10

Wow, what an event!

We would like to thank you for contributing to the magic of Drupal Mountain Camp 2024 and making it tremendous success!

From the snow-capped peaks of learning to the comfy fireside chats of networking, the event was a one-of-a-kind experience that left a lasting imprint on all of us.

As I look back on the laughter-filled evenings and the insightful discussions that echoed through the venue to the fondue evening, I'm reminded of the incredible sense of community that defines us.

We are immensely grateful for the insightful presentations by our honoured speakers, the generous support from our valuable sponsors, and the dedication and hard work of our volunteers to ensure the event's success.

Together, we explored new ideas, shared knowledge, and forged meaningful connections within the Drupal community.

As we reflect on the success of this year's conference, we're already looking forward to what lies ahead for the next Drupal Mountain Camp.

 

 

Feedback

We implore everyone to submit their feedback to each session they attended by going to the schedule and clicking on each session, then giving a quick anonymous feedback.

The schedule should still be available via the custom domain:
https://event.drupalmountaincamp.ch/drupal-mountain-camp-2024/schedule/

Furthermore, we would greatly appreciate all feedback regarding the conference as a whole to be submitted on the "Closing Session".

 

Highlights

Here's some of the statistics that we calculated from the event.

  • 77 participants
  • 350+ coffees consumed
  • 63 Fondues eaten at Schatzalp
  • 39 People took the sled down Schatzalp
  • 0 Injuries
  • 11 Sponsors
  • 12 Team members
  • 6 Volunteers
  • 17.65% Diverse Speakers
  • 58 Posts in LinkedIn, Instagram Twitter and Mastodon
  • 236 Unique Visitors on LinkedIn since Nov 11
  • 25 issues worked on #MountainCamp2024

Participants per Country

  • 46    Switzerland (CH)
  • 6    Belgium (BE)
  • 5    United Kingdom (GB)
  • 4    Germany (DE)
  • 3    Finland (FI)
  • 3    France (FR)
  • 2    Slovenia (SI)
  • 2    United States (US)
  • 1    Australia (AU)
  • 1    Austria (AT)
  • 1    Bulgaria (BG)
  • 1    Portugal (PT)
  • 1    Spain (ES)
  • 1    Suriname (SR)

 

Media

We're very grateful to have such an awesome media team to capture every single moment.

Official photos by Patrick Itten
https://foto.patrickitten.ch/drupal-mountain-camp-2024

Photos by Josef Kruckenberg
https://www.flickr.com/photos/185226958@N05/albums/72177720315270848/

Relive the recap here by Dan Lemon
https://youtu.be/Z6AX_gexOg0

Extended fondue and sledding with the little happy birthday surprise
https://youtu.be/BgBzHbveSdE

 

Session Videos

We were able to record all the keynote sessions along with all sessions that took place in the Pischa room.

You can find the session videos on our YouTube Channel, under the playlist title "Sessions - Drupal Mountain Camp 2024"

https://www.youtube.com/playlist?list=PL6C9y4dEueZhksow0hSYFsPKGIo2c735C

 

Aaron Winborn Award

This is a reminder that the Aaron Winborn award nominations are open until Friday, March 29, 2024

This annual award recognizes an individual who demonstrates personal integrity, kindness, and above-and-beyond commitment to the Drupal community.
It includes a scholarship and travel stipend for the winner to attend DrupalCon North America and recognition in a plenary session at the event.

https://www.drupal.org/community/cwg/blog/nominations-are-now-open-for-the-2024-aaron-winborn-award

 

What's Next

Drupal Switzerland Association plans to host further in-person events throughout the year, such as gatherings in Zurich, Bern, and hopefully somewhere in the Swiss Romandie area.

We will post new events to our meetup.com account, as well as cross-posting to our Drupal Switzerland Slack and also to Drupal Groups:
https://www.meetup.com/zurich-drupal-meetup/
https://groups.drupal.org/switzerland

Furthermore, we'd like to highlight these two upcoming events for the Drupal community.

 

Drupal Dev Days Burgas

Drupal Developer Days is an annual gathering of people loving, learning, and discussing all things relating to Drupal. This year it'll be hosted by Drupal Bulgaria in Burgas, by the seaside.

The event is planned to take place between June 26-28, 2024 at Burgas Free University in Burgas, Bulgaria.

Drupal Dev Days 2024 is going to be a 3-day event full of amazing sessions, workshops and discussions as well as various social events and other surprises. 

Find out more on their website
https://ddd2024.drupalcamp.bg/

 

DrupalCon Barcelona

You may have seen Mercè in Davos, the mascot for DrupalCon Barcelona. Kuoni-Tumlare will calculate out who won the contest for a free ticket to DrupalCon Barcelona 2024.

This year's DrupalCon takes place from September 24-27, 2024 at the stunning Centre de convencions internacional de Barcelona (CCIB).

Barcelona's accessibility ensures that this event is within reach for all Drupal enthusiasts.

https://events.drupal.org/barcelona2024

 

A Final Thank You

We'd like to extend our deepest gratitude to our valuable sponsors, whose generous support made Drupal Mountain Camp 2024 possible.

To our esteemed speakers, thank you for sharing your expertise and insights, enriching the experience for all attendees.

A heartfelt thank you to our dedicated volunteers, whose hard work and enthusiasm ensured the smooth execution of every detail.

And last but certainly not least, to all our participants, thank you for bringing your passion and energy, making Drupal Mountain Camp a vibrant and unforgettable gathering.

Your contributions have truly made a difference and have left a lasting impact on our community.

Until we meet again, let's continue to collaborate, learn, and grow together in the spirit of Drupal.

 

On behalf of the Drupal Mountain Camp organisation team,
Dan Lemon

 

Kategorien: Drupal News

Drupal.org blog: What's next for (Drupal) innovation

Drupal News - Mo, 03/18/2024 - 12:39

Last year the Drupal Association brought me onto the team using a special board vision fund to help kick off our first steps in increasing our focus on innovation.

This phase is coming to an end in May with the end of my contract, and right in time for Drupalcon Portland. I am incredible grateful for this past months, for all the people and friends I've met inside and outside of the Drupal Association, for all the work we've done together, and for all the work that is still to come.

But before I wrap up my work with the team I want to report on the progress we've made so far, what we're still working on until May, and what happens next.

Alex took on a herculean task when he joined us for this special engagement to help determine our strategy for accelerating innovation in Drupal. I'm extremely grateful for what he's accomplished and proud to have had him join our team.

Thanks to his work we've fostered 6 fantastic projects through Pitchburgh grant funding, completed a study of friction points in our new user registration, onboarding and contribution process, identified an action plan to better onboard new contributors, improve open source contribution and set our sights on even higher goals.

I'd love to see Drupal step forward to help us take the next step!

Tim Lehnen CTO
Drupal Association

Lots of work to be proud of

Innovation Working Group

The Innovation working group is a gathering happening every other week, in  which we report progress on ongoing initiatives as well as discuss everything related to innovation, from contributor guidance, to documentation. As part of my role I took the leadership of the working group, and steered the direction of the discussions as well as the topics to be discussed.

Some of the initiatives that started as a seed from that group are the research on the documentation improvements (spearheaded by Mike Herschel), the onboarding analysis (executed by myself), the Drupal Acceleration team proposal (led by Laurii and Cristina Chumillas), a conversation about the relative value of a credit to the contributor wage invested, and many more.

As a personal note, I have to thank the whole group for their passion and commitment to improving Drupal, and especially for their patience with me while I was trying to find my place in this new world that I joined in 2023.

Pitchburgh

Pitchburgh was kick-started by Dries during Drupalcon Pittsburgh 2023, and consists of an innovation contest in which participants would propose their innovative ideas for Drupal, and a mix between judges and people at Drupalcon itself would vote the winners.

Acting as the program manager / coordinator of the 6 projects, my role helped on a diverse range of tasks, sometimes outside of my own zone of comfort, like getting contracts ready for sign up, syncing with core committers when needed, communications and relations with the community and a broad range of other tasks.

We're proud to be sharing the success stories of each of these projects at DrupalCon Portland in May.

Contribution Health Dashboards

As part of the feedback from the Innovation Working Group we took care of creating a series of dashboards and Drush scripts with the goal of getting a better understanding of the contribution ecosystem in Drupal, finding what needs improvement and how any changes introduced in the ecosystem would impact the platform.

From these dashboards we can track the impact of our work to improve contributor onboarding.

Onboarding new users/contributors

The first contact a big portion of our users have with Drupal is our drupal.org registration. Improving that process not only ensures that we are delivering the image and branding that Drupal deserves, but also we maximize the opportunities to convert those users from takers to makers. The start of 2024 was full of research and investigation on the outdated registration flow, a set of recommendations have been put in place, and changes have already started, including a more prominent presence of guidance and help for new want-to-be contributors.

We'll be implementing a new 'persona' field to help us categorize new users and set them on the appropriate journey for their role.

Contribution friction analysis

When a hindrance obstructs innovation, it often persists for months or even years. The extended duration of the contribution pipeline presents an opportunity to reduce this time to contribution, enhance the velocity of Open Source projects, in this case Drupal, and accelerate Drupal's development process.

During different times we went through the contribution process in Drupal, aiming to identify friction points and other blockers, while I also kept conversations with different members of the community, contributors and core members. I expect to publish this research and my findings and recommendations prior to Drupalcon Portland, and I hope that this will provide valuable insights into the factors impeding contribution and suggesting strategies to optimize efforts.

For more information, join my session, co-presented with Irina Zaks (who has also been researching on this topic) at DrupalCon portland, titled: Innovation and contribution challenges

Bounty program

The Bounty program was a pilot program with the idea to research possible solutions to a few common problems, the most important one, ensure contributions happen where Drupal and the Drupal Association needs them more, which is, for example (but not only), strategic initiatives and innovation projects.

The program was successful as it resuscitated some old, sleeping issues, and even solved one of them (which was open for more than 4 years) in just a few weeks. The program demonstrated the need of soft steering in the right direction, and a phase 2 has already been started with the aim to make an ever wider impact.

Read about the Bounty program here, and the Bounty program extension here.

Contributor (priorities) guide

The Bounty program, together with conversations we’ve been having with companies and partners, also inspired us to create a contributor guide which helps companies and individuals to steer everyone on the right path towards contributions that are more meaningful and have higher impact in the community.

You can read the priority guide contributor announcement here: Maximizing contributions

Innovation landing

One of the realizations during this time collaborating with the Innovation Working Group is that innovation will not come from specific individuals or even necessarily from a group. 

Drupal is a highly decentralized community, and innovation will come from that community. We have a huge amount of modules, which is one of our biggest strengths. But that as well means that we need to ensure that we keep our conversations and meetings diverse enough. The community needs to surface those projects that are innovative.

The next big leap is probably hidden, deep in a sea of ideas and projects. Hence, the only way to ensure that we don’t miss the next wave is to ensure that everyone has a voice.

That’s why we agreed early to create an innovation landing page, which could capture the essence of Drupal Innovation, serve as a center of information, and inspire others to do more of the great things that we are used to seeing in our community.
 

More for us to do!

Drupal has always been a do-ocracy- where passionate, motivated contributors with a great idea can roll up their sleeves and get things done. The work above represents some great first steps (and it's hard to believe how fast time flew by!) but as a community we have to come together with a collective commitment to do more.

Innovation does not stop here, my work was just the beginning, setting up the base of what’s next. The Drupal association needs your help, so moving forward we could:

  • Creating a dedicated innovation fund that partner organizations and individuals can contribute to, to make specific, targeted investments in innovation
  • Grant Fundraising and Sponsorship for dedicated roles within the Drupal Association
    • For example - partners could come together to 'endow' a position for a role like mine of Innovation Program manager to be made permanent.
    • And/Or for roles like a Contribution Success Manager
    • And/Or for direct core contribution engineers

Only together will we be able to scale the pace of innovation in Drupal - and we have so many capable people in our community that our biggest barrier is only finding the resources to make our vision a reality. That is something we can solve together.

On a personal note, while my engagement is coming to a close, this is not a goodbye. I'm more committed than ever to the Drupal community and excited about its future. If you want to support our continued efforts to work with the Drupal Association on these goals, please let us know: alex@association.drupal.org

Kategorien: Drupal News

Golems GABB: Advanced Content Management with the Paragraphs Module in Drupal

Drupal News - Mo, 03/18/2024 - 12:13
Advanced Content Management with the Paragraphs Module in Drupal Editor Mon, 03/18/2024 - 12:13

Creating user-friendly and stylish web pages can sometimes make you nervous, and maybe you want to turn off your computer - does that sound familiar? Even using popular CMSs, including Drupal, sometimes it is difficult to understand this issue and create a functional, modern website. Drupal can offer several effective solutions, and today, we will look at one of them - the Drupal Paragraphs module.
Creating a home page, or even a regular page on a website, requires much effort and time unless you're a professional web developer. Many people with initial design skills face similar problems and spend much time searching for solutions. Often, everything comes with experience. Through trial and error, reading various articles, and watching videos on YouTube, we are looking for an opportunity to achieve the goal.

Kategorien: Drupal News

LN Webworks: Drupal Community Module Evaluation: A Go-to Guide

Drupal News - Mo, 03/18/2024 - 11:47

It's not only about what a module from the Drupal community can achieve when you consider using it. Along with how long you want your website to remain, you need also to consider who will maintain it after it goes up. These factors influence the level of danger you are willing to accept. 

For instance, you might desire modules with an excellent track record and robust community support if you're not too familiar with Drupal.

Every module available on Drupal.org is licensed under the GPLv2 and is open source. This means that while they are free to use, any dangers are your responsibility but every module has a community of users who assist with problems and updates, as well as a team of maintainers for each module. Additionally, partnering with a reputable Drupal web development company can provide further assurance in terms of module selection, ongoing support, and maintenance.

Let's discuss some factors to consider when evaluating a community module.

Kategorien: Drupal News

Neue physikalische Netzwerkkarte in ESXi V.8 zufügen

Virtualisierungen - Sa, 03/16/2024 - 13:10
Question: Ich habe auf einem Lenovo ThinkServer ein ESXi-Host V. 8 laufen. Die eingebaute Intel-Netzwerkkarte funktioniert einwandfrei. Jetzt habe ich eine 10GBit-Netzwerkkarte mit einem Broadcom-Chip (BCM57810S)... 11 Kommentare, 1163 mal gelesen.
Kategorien: Anleitungen

The Drop Times: Drupal is Alive and Well in India: Tim Doyle

Drupal News - Fr, 03/15/2024 - 15:49
Tim Doyle, CEO of Drupal Association, reflects on a vibrant gathering of industry leaders and young talents in India, showcasing the potential and enthusiasm within the country's Drupal community.
Kategorien: Drupal News

Acquia Developer Portal Blog: Running Nightwatch tests in Acquia Code Studio

Drupal News - Fr, 03/15/2024 - 15:49

Nightwatch is an automated testing framework for web applications and websites. It uses the W3C WebDriver API to simulate real user interactions in a web browser environment, such as Chrome, to test the complete flow of an application, end-to-end.

In this tutorial, we'll see how we can extend the Acquia AutoDevOps template that comes out-of-the-box with Code Studio to also run Nightwatch tests for our application so we can ensure critical features remain functional as we further develop and maintain it.

  1. A simple Nightwatch test

    To start, let's first add a simple Nightwatch test to verify Drupal is up and running by navigating to the Drupal login page and

Kategorien: Drupal News

Acquia Developer Portal Blog: EvolveDrupal Guide

Drupal News - Fr, 03/15/2024 - 15:49
About the Host, Evolving Web

Evolving Web is the agency partner that empowers organizations to adapt to the ever-changing digital landscape. We’re a team of 90+ technologists, storytellers and creatives who believe that a dynamic and adaptable digital presence is the most powerful way for clients to create meaningful connections. Through strategy, technology, design, marketing, and training, we set stories in motion through digital platforms designed for growth. 

Evolving Web was founded in 2007 by two passionate Drupalists on the ideals that define the open source ethos: transparency, collaboration, and continuous improvement. Then and now, we believe in the power of open source to drive innovation and growth. Our team regularly contributes to the open source community through code, documentation, sponsorship, strategic initiatives, and events like EvolveDrupal. 

Kategorien: Drupal News

Acquia Developer Portal Blog: Getting Started with Acquia Cloud IDE: A Code Editor as a Service

Drupal News - Fr, 03/15/2024 - 15:49

There are two main challenges developers face when setting up and managing their local environments: 

  1. Lack of local resources (You need a powerful machine to run Docker.)
  2. Lots of time spent configuring environments, especially if you want to build something more sophisticated

While it may be fun experimenting with Linux and everything related to DevOps, sometimes you just don’t have the time. Sound familiar?

Don’t take my word for it. Check out this Twitter poll conducted by a former colleague:

The results could not be more clear. Developers want simplicity. Fair, right? You have enough stress and problems to solve as you work to meet tight deadlines.

Kategorien: Drupal News

Lullabot: Lullabot Podcast: Ease of Updates, Compounded Peace of Mind

Drupal News - Fr, 03/15/2024 - 05:00

We look into the challenges and solutions in managing Drupal and other website updates across hundreds of websites, a topic brought to life by members of Lullabot's Support and Maintenance team and Jenna Tollerson from the State of Georgia.

Learn how Lullabot deals with update processes, drastically reducing manual labor while enhancing security and efficiency through automation.

"It's almost like adding another whole developer to your team!"

Kategorien: Drupal News

Dries Buytaert: Building my own temperature and humidity monitor

Drupal News - Do, 03/14/2024 - 15:04

Last fall, we toured the Champagne region in France, famous for its sparkling wines. We explored the ancient, underground cellars where Champagne undergoes its magical transformation from grape juice to sparkling wine. These cellars, often 30 meters deep and kilometers long, maintain a constant temperature of around 10-12°C, providing the perfect conditions for aging and storing Champagne.

25 meters underground in a champagne tunnel, which often stretches for miles/kilometers.

After sampling various Champagnes, we returned home with eight cases to store in our home's basement. However, unlike those deep cellars, our basement is just a few meters deep, prompting a simple question that sent me down a rabbit hole: how does our basement's temperature compare?

Rather than just buying a thermometer, I decided to build my own "temperature monitoring system" using open hardware and custom-built software. After all, who needs a simple solution when you can spend evenings tinkering with hardware, sensors, wires and writing your own software? Sometimes, more is more!

The basic idea is this: track the temperature and humidity of our basement every 15 minutes and send this information to a web service. This web service analyzes the data and alerts us if our basement becomes too cold or warm.

I launched this monitoring system around Christmas last year, so it's been running for nearly three months now. You can view the live temperature and historical data trends at https://dri.es/sensors. Yes, publishing our basement's temperature online is a bit quirky, but it's all in good fun.

A screenshot of my basement temperature dashboard.

So far, the temperature in our basement has been ideal for storing wine. However, I expect it will change during the summer months.

In the rest of this blog post, I'll share how I built the client that collects and sends the data, as well as the web service backend that processes and visualizes that data.

Hardware used

For this project, I bought:

  1. Adafruit ESP32-S3 Feather: A microcontroller board with Wi-Fi and Bluetooth capabilities, serving as the central processing unit of my project.
  2. Adafruit SHT4x sensor: A high-accuracy temperature and humidity sensor.
  3. 3.7v 500mAh battery: A small and portable power source.
  4. STEMMA QT / Qwiic JST SH 4-pin cable: To connect the sensor to the board without soldering.

The total hardware cost was $32.35 USD. I like Adafruit a lot, but it's worth noting that their products often come at a higher cost. You can find comparable hardware for as little as $10-15 elsewhere. Adafruit's premium cost is understandable, considering how much valuable content they create for the maker community.

An ESP32-S3 development board (middle) linked to an SHT41 temperature and humidity sensor (left) module and powered by a battery pack (right). Client code for Adafruit ESP32-S3 Feather

I developed the client code for the Adafruit ESP32-S3 Feather using the Arduino IDE, a widely used platform for developing and uploading code to Arduino-compatible boards.

The code measures temperature and humidity every 15 minutes, connects to WiFi, and sends this data to https://dri.es/sensors, my web service endpoint.

One of my goals was to create a system that could operate for a long time without needing to recharge the battery. The ESP32-S3 supports a "deep sleep" mode where it powers down almost all its functions, except for the clock and memory. By placing the ESP32-S3 into deep sleep mode between measurements, I was able to significantly reduce power.

Now that you understand the high-level design goals, including deep sleep mode, I'll share the complete client code below. It includes detailed code comments, making it self-explanatory.

[code c]#include "Adafruit_SHT4x.h" #include "Adafruit_MAX1704X.h" #include "WiFiManager.h" #include "ArduinoJson.h" #include "HTTPClient.h" // The Adafruit_SHT4x sensor is a high-precision, temperature and humidity // sensor with I2C interface. Adafruit_SHT4x sht4 = Adafruit_SHT4x(); // The Adafruit ESP32-S3 Feather comes with a built-in MAX17048 LiPoly / LiIon // battery monitor. The MAX17048 provides accurate monitoring of the battery's // voltage. Utilizing the Adafruit library, not only helps us obtain the raw // voltage data from the battery cell, but also converts this data into a more // intuitive battery percentage or charge level. We will pass on the battery // percentage to the web service endpoint, which can visualize it or use it to // send notifications when the battery needs recharging. Adafruit_MAX17048 maxlipo; void setup() { Serial.begin(115200); // Wait for the serial connection to establish before proceeding further. // This is crucial for boards with native USB interfaces. Without this loop, // initial output sent to the serial monitor is lost. This code is not // needed when running on battery. //delay(1000); // Generates a unique device ID from a segment of the MAC address. // Since the MAC address is permanent and unchanged after reboots, // this guarantees the device ID remains consistent. To achieve a // compact ID, only a specific portion of the MAC address is used, // specifically the range between 0x10000 and 0xFFFFF. This range // translates to a hexadecimal string of a fixed 5-character length, // giving us roughly 1 million unique IDs. This approach balances // uniqueness with compactness. uint64_t chipid = ESP.getEfuseMac(); uint32_t deviceValue = ((uint32_t)(chipid >> 16) & 0x0FFFFF) | 0x10000; char device[6]; // 5 characters for the hex representation + the null terminator. sprintf(device, "%x", deviceValue); // Use '%x' for lowercase hex letters // Initialize the SHT4x sensor: if (sht4.begin()) { Serial.println(F("SHT4 temperature and humidity sensor initialized.")); sht4.setPrecision(SHT4X_HIGH_PRECISION); sht4.setHeater(SHT4X_NO_HEATER); } else { Serial.println(F("Could not find SHT4 sensor.")); } // Initialize the MAX17048 sensor: if (maxlipo.begin()) { Serial.println(F("MAX17048 battery monitor initialized.")); } else { Serial.println(F("Could not find MAX17048 battery monitor!")); } // Insert a short delay to ensure the sensors are ready and their data is stable: delay(200); // Retrieve temperature and humidity data from SHT4 sensor: sensors_event_t humidity, temp; sht4.getEvent(&humidity, &temp); // Get the battery percentage and calibrate if it's over 100%: float batteryPercent = maxlipo.cellPercent(); batteryPercent = (batteryPercent > 100) ? 100 : batteryPercent; WiFiManager wifiManager; // Uncomment the following line to erase all saved WiFi credentials. // This can be useful for debugging or reconfiguration purposes. // wifiManager.resetSettings(); // This WiFI manager attempts to establish a WiFi connection using known // credentials, stored in RAM. If it fails, the device will switch to Access // Point mode, creating a network named "Temperature Monitor". In this mode, // connect to this network, navigate to the device's IP address (default IP // is 192.168.4.1) using a web browser, and a configuration portal will be // presented, allowing you to enter new WiFi credentials. Upon submission, // the device will reboot and try connecting to the specified network with // these new credentials. if (!wifiManager.autoConnect("Temperature Monitor")) { Serial.println(F("Failed to connect to WiFi ...")); // If the device fails to connect to WiFi, it will restart to try again. // This approach is useful for handling temporary network issues. However, // in scenarios where the network is persistently unavailable (e.g. router // down for more than an hour, consistently poor signal), the repeated // restarts and WiFi connection attempts can quickly drain the battery. ESP.restart(); // Mandatory delay to allow the restart process to initiate properly: delay(1000); } // Send collected data as JSON to the specified URL: sendJsonData("https://dri.es/sensors", device, temp.temperature, humidity.relative_humidity, batteryPercent); // WiFi consumes significant power so turn it off when done: WiFi.disconnect(true); // Enter deep sleep for 15 minutes. The ESP32-S3's deep sleep mode minimizes // power consumption by powering down most components, except the RTC. This // mode is efficient for battery-powered projects where constant operation // isn't needed. When the device wakes up after the set period, it runs // setup() again, as the state isn't preserved. Serial.println(F("Going to sleep for 15 minutes ...")); ESP.deepSleep(15 * 60 * 1000000); // 15 mins * 60 secs/min * 1,000,000 μs/sec. } bool sendJsonData(const char* url, const char* device, float temperature, float humidity, float battery) { StaticJsonDocument<200> doc; // Round floating-point values to one decimal place for efficient data // transmission. This approach reduces the JSON payload size, which is // important for IoT applications running on batteries. doc["device"] = device; doc["temperature"] = String(temperature, 1); doc["humidity"] = String(humidity, 1); doc["battery"] = String(battery, 1); // Serialize JSON to a string: String jsonData; serializeJson(doc, jsonData); // Initialize an HTTP client with provided URL: HTTPClient httpClient; httpClient.begin(url); httpClient.addHeader("Content-Type", "application/json"); // Send a HTTP POST request: int httpCode = httpClient.POST(jsonData); // Close the HTTP connection: httpClient.end(); // Print debug information to the serial console: Serial.println("Sent '" + jsonData + "' to " + String(url) + ", return code " + httpCode); return (httpCode == 200); } void loop() { // The ESP32-S3 resets and runs setup() after waking up from deep sleep, // making this continuous loop unnecessary. }[/code] Further optimizing battery usage

When I launched my thermometer around Christmas 2023, the battery was at 88%. Today, it is at 52%. Some quick math suggests it's using approximately 12% of its battery per month. Given its current rate of usage, it needs recharging about every 8 months.

Connecting to the WiFi and sending data are by far the main power drains. To extend the battery life, I could send updates less frequently than every 15 minutes, only send them when there is a change in temperature (which is often unchanged or only different by 0.1°C), or send batches of data points together. Any of these methods would work for my needs, but I haven't implemented them yet.

Alternatively, I could hook the microcontroller up to a 5V power adapter, but where is the fun in that? It goes against the project's "more is more" principle.

Handling web service requests

With the client code running on the ESP32-S3 and sending sensor data to https://dri.es/sensors, the next step is to set up a web service endpoint to receive this incoming data.

As I use Drupal for my website, I implemented the web service endpoint in Drupal. Drupal uses Symfony, a popular PHP framework, for large parts of its architecture. This combination offers an easy but powerful way for implementing web services, similar to those found across other modern server-side web development frameworks like Laravel, Django, etc.

Here is what my Drupal routing configuration looks like:

[code yaml]sensors.sensor_data: path: '/sensors' methods: [POST] defaults: _controller: '\Drupal\sensors\Controller\SensorMonitorController::postSensorData' requirements: _permission: 'access content'[/code]

The above configuration directs Drupal to send POST requests made to https://dri.es/sensors to the postSensorData() method of the SensorMonitorController class.

The implementation of this method handles request authentication, validates the JSON payload, and saves the data to MariaDB database table. Pseudo-code:

[code php]public function postSensorData(Request $request) : JsonResponse { $content = $request->getContent(); $data = json_decode($content, TRUE); // Validate the JSON payload: … // Authenticate the request: … $device = DeviceFactory::getDevice($data['device']); if ($device) { $device->recordSensorEvent($data); } return new JsonResponse(['message' => 'Thank you!']); }[/code]

For testing your web service, you can use tools like cURL:

[code bash]$ curl -X POST -H "Content-Type: application/json" -d '{"device":"0xdb123", "temperature":21.5, "humidity":42.5, "battery":90.0}' https://localhost/sensors[/code]

While cURL is great for quick tests, I use PHPUnit tests for automated testing in my CI/CD workflow. This ensures that everything keeps working, even when upgrading Drupal, Symfony, or other components of my stack.

Storing sensor data in a database

The primary purpose of $device->recordSensorEvent() in SensorMonitorController::postSensorData() is to store sensor data into a SQL database. So, let's delve into the database design.

My main design goals for the database backend were:

  1. Instead of storing every data point indefinitely, only keep the daily average, minimum, maximum, and the latest readings for each sensor type across all devices.
  2. Make it easy to add new devices and new sensors in the future. For instance, if I decide to add a CO2 sensor for our bedroom one day (a decision made in my head but not yet pitched to my better half), I want that to be easy.

To this end, I created the following MariaDB table:

[code sql]CREATE TABLE sensor_data ( date DATE, device VARCHAR(255), sensor VARCHAR(255), avg_value DECIMAL(5,1), min_value DECIMAL(5,1), max_value DECIMAL(5,1), min_timestamp DATETIME, max_timestamp DATETIME, readings SMALLINT NOT NULL, UNIQUE KEY unique_stat (date, device, sensor) );[/code]

A brief explanation for each field:

  • date: The date for each sensor reading. It doesn't include a time component as we aggregate data on a daily basis.
  • device: The device ID of the device providing the sensor data, such as 'basement' or 'bedroom'.
  • sensor: The type of sensor, such as 'temperature', 'humidity' or 'co2'.
  • avg_value: The average value of the sensor readings for the day. Since individual readings are not stored, a rolling average is calculated and updated with each new reading using the formula: avg_value = avg_value + new_value - avg_value new_total_readings . This method can accumulate minor rounding errors, but simulations show these are negligible for this use case.
  • min_value and max_value: The daily minimum and maximum sensor readings.
  • min_timestamp and max_timestamp: The exact moments when the minimum and maximum values for that day were recorded.
  • readings: The number of readings (or measurements) taken throughout the day, which is used for calculating the rolling average.

In essence, the recordSensorEvent() method needs to determine if a record already exists for the current date. Depending on this determination, it will either insert a new record or update the existing one.

In Drupal this process is streamlined with the merge() function in Drupal's database layer. This function handles both inserting new data and updating existing data in one step.

[code php]private function updateDailySensorEvent(string $sensor, float $value): void { $timestamp = \Drupal::time()->getRequestTime(); $date = date('Y-m-d', $timestamp); $datetime = date('Y-m-d H:i:s', $timestamp); $connection = Database::getConnection(); $result = $connection->merge('sensor_data') ->keys([ 'device' => $this->id, 'sensor' => $sensor, 'date' => $date, ]) ->fields([ 'avg_value' => $value, 'min_value' => $value, 'max_value' => $value, 'min_timestamp' => $datetime, 'max_timestamp' => $datetime, 'readings' => 1, ]) ->expression('avg_value', 'avg_value + ((:new_value - avg_value) / (readings + 1))', [':new_value' => $value]) ->expression('min_value', 'LEAST(min_value, :value)', [':value' => $value]) ->expression('max_value', 'GREATEST(max_value, :value)', [':value' => $value]) ->expression('min_timestamp', 'IF(LEAST(min_value, :value) = :value, :timestamp, min_timestamp)', [':value' => $value, ':timestamp' => $datetime]) ->expression('max_timestamp', 'IF(GREATEST(max_value, :value) = :value, :timestamp, max_timestamp)', [':value' => $value, ':timestamp' => $datetime]) ->expression('readings', 'readings + 1') ->execute(); }[/code]

Here is what the query does:

  • It checks if a record for the current sensor and date exists.
  • If not, it creates a new record with the sensor data, including the initial average, minimum, maximum, and latest value readings, along with the timestamp for these values.
  • If a record does exist, it updates the record with the new sensor data, adjusting the average value, and updating minimum and maximum values and their timestamps if the new reading is a new minimum or maximum.
  • The function also increments the count of readings.

For those not using Drupal, similar functionality can be achieved with MariaDB's INSERT ... ON DUPLICATE KEY UPDATE command, which allows for the same conditional insert or update logic based on whether the specified unique key already exists in the table.

Here are example queries, extracted from MariaDB's General Query Log to help you get started:

[code sql]INSERT INTO sensor_data (device, sensor, date, min_value, min_timestamp, max_value, max_timestamp, readings) VALUES ('0xdb123', 'temperature', '2024-01-01', 21, '2024-01-01 00:00:00', 21, '2024-01-01 00:00:00', 1); UPDATE sensor_data SET min_value = LEAST(min_value, 21), min_timestamp = IF(LEAST(min_value, 21) = 21, '2024-01-01 00:00:00', min_timestamp), max_value = GREATEST(max_value, 21), max_timestamp = IF(GREATEST(max_value, 21) = 21, '2024-01-01 00:00:00', max_timestamp), readings = readings + 1 WHERE device = '0xdb123' AND sensor = 'temperature' AND date = '2024-01-01';[/code] Generating graphs

With the data securely stored in the database, the next step involved generating the graphs. To accomplish this, I wrote some custom PHP code that generates Scalable Vector Graphics (SVGs).

Given that is blog post is already quite long, I'll spare you the details. For now, those curious can use the 'View source' feature in their web browser to examine the SVGs on the thermometer page.

Conclusion

It's fun how a visit to the Champagne cellars in France sparked an unexpected project. Choosing to build a thermometer rather than buying one allowed me to dive back into an old passion for hardware and low-level software.

I also like taking control of my own data and software. It gives me a sense of control and creativity.

As Drupal's project lead, using Drupal for an Internet-of-Things (IoT) backend brought me unexpected joy. I just love the power and flexibility of open-source platforms like Drupal.

As a next step, I hope to design and 3D print a case for my thermometer, something I've never done before. And as mentioned, I'm also considering integrating additional sensors. Stay tuned for updates!

Kategorien: Drupal News

Dries Buytaert: Drupal adventures in Japan and Australia

Drupal News - Do, 03/14/2024 - 15:04

Next week, I'm traveling to Japan and Australia. I've been to both countries before and can't wait to return – they're among my favorite places in the world.

My goal is to connect with the local Drupal community in each country, discussing the future of Drupal, learning from each other, and collaborating.

I'll also be connecting with Acquia's customers and partners in both countries, sharing our vision, strategy and product roadmap. As part of that, I look forward to spending some time with the Acquia teams as well – about 20 employees in Japan and 35 in Australia.

I'll present at a Drupal event in Tokyo the evening of March 14th at Yahoo! Japan.

While in Australia, I'll be attending Drupal South, held at the Sydney Masonic Centre from March 20-22. I'm excited to deliver the opening keynote on the morning of March 20th, where I'll delve into Drupal's past, present, and future.

I look forward to being back in Australia and Japan, reconnecting with old friends and the local communities.

Kategorien: Drupal News

Dries Buytaert: Two years later: is my Web3 website still standing?

Drupal News - Do, 03/14/2024 - 15:04

Two years ago, I launched a simple Web3 website using IPFS (InterPlanetary File System) and ENS (Ethereum Name Service). Back then, Web3 tools were getting a lot of media attention and I wanted to try it out.

Since I set up my Web3 website two years ago, I basically forgot about it. I didn't update it or pay attention to it for two years. But now that we hit the two-year mark, I'm curious: is my Web3 website still online?

At that time, I also stated that Web3 was not fit for hosting modern web applications, except for a small niche: static sites requiring high resilience and infrequent content updates.

I was also curious to explore the evolution of Web3 technologies to see if they became more applicable for website hosting.

My original Web3 experiment

In my original blog post, I documented the process of setting up what could be called the "Hello World" of Web3 hosting. I stored an HTML file on IPFS, ensured its availability using "pinning services", and made it accessible using an ENS domain.

For those with a basic understanding of Web3, here is a summary of the steps I took to launch my first Web3 website two years ago:

  1. Purchased an ENS domain name: I used a crypto wallet with Ethereum to acquire dries.eth through the Ethereum Name Service, a decentralized alternative to the traditional DNS (Domain Name System).
  2. Uploaded an HTML File to IPFS: I uploaded a static HTML page to the InterPlanetary File System (IPFS), which involved running my own IPFS node and utilizing various pinning services like Infura, Fleek, and Pinata. These pinning services ensure that the content remains available online even when my own IPFS node is offline.
  3. Accessed the website: I confirmed that my website was accessible through IPFS-compatible browsers.
  4. Mapped my webpage to my domain name: As the last step, I linked my IPFS-hosted site to my ENS domain dries.eth, making the web page accessible under an easy domain name.

If the four steps above are confusing to you, I recommend reading my original post. It is over 2,000 words, complete with screenshots and detailed explanations of the steps above.

Checking the pulse of various Web3 services

As the first step in my check-up, I wanted to verify if the various services I referenced in my original blog post are still operational.

The results, displayed in the table below, are really encouraging: Ethereum, ENS, IPFS, Filecoin, Infura, Fleek, Pinata, and web3.storage are all operational.

The two main technologies – ENS and IPFS – are both actively maintained and developed. This indicates that Web3 technology has built a robust foundation.

Service Description Still around in February 2024) ENS A blockchain-based naming protocol offering DNS for Web3, mapping domain names to Ethereum addresses. Yes IPFS A peer-to-peer protocol for storing and sharing data in a distributed file system. Yes Filecoin A blockchain-based storage network and cryptocurrency that incentivizes data storage and replication. Yes Infura Provides tools and infrastructure to manage content on IPFS and other tools for developers to connect their applications to blockchain networks and deploy smart contracts. Yes Fleek A platform for building websites using IPFS and ENS. Yes Pinata Provides tools and infrastructure to manage content on IPFS, and more recently Farcaster applications. Yes web3.storage Provides tools and infrastructure to manage content on IPFS with support for Filecoin. Yes Is my Web3 website still up?

Seeing all these Web3 services operational is encouraging, but the ultimate test is to check if my Web3 webpage, dries.eth, remained live. It's one thing for these services to work, but another for my site to function properly. Here is what I found in a detailed examination:

  1. Domain ownership verification: A quick check on etherscan.io confirmed that dries.eth is still registered to me. Relief!
  2. ENS registrar access: Using my crypto wallet, I could easily log into the ENS registrar and manage my domains. I even successfully renewed dries.eth as a test.
  3. IPFS content availability: My webpage is still available on IPFS, thanks to having pinned it two years ago. Logging into Fleek and Pinata, I found my content on their admin dashboards.
  4. Web3 and ENS gateway access: I can visit dries.eth using a Web3 browser, and also via an IPFS-compatible ENS gateway like https://dries.eth.limo/ – a privacy-centric service, new since my initial blog post.

The verdict? Not only are these Web3 services still operational, but my webpage also continues to work!

This is particularly noteworthy given that I haven't logged in to these services, didn't perform any maintenance, or didn't pay any hosting fees for two years (the pinning services I'm using have a free tier).

Visit my Web3 page yourself

For anyone interested in visiting my Web3 page (perhaps your first Web3 visit?), there are several methods to choose from, each with a different level of Web3-ness.

  • Use a Web3-enabled browser: Browsers such as Brave and Opera, offer built-in ENS and IPFS support. They can resolve ENS addresses and interpret IPFS addresses, making it as easy to navigate IPFS content as if it is traditional web content via HTTP or HTTPS.
  • Install a Web3 browser extension: If your favorite browser does not support Web3 out of the box, adding a browser extension like MetaMask can help you access Web3 applications. MetaMask works with Chrome, Firefox, and Edge. It enables you to use .eth domains for doing Ethereum transactions or for accessing content on IPFS.
  • Access through an ENS gateway: For those looking for the simplest way to access Web3 content without installing anything new, using an ENS gateway, such as eth.limo, is the easiest method. This gateway maps ENS domains to DNS, offering direct navigation to Web3 sites like mine at https://dries.eth.limo/. It serves as a simple bridge between Web2 (the conventional web) and Web3.
Streamlining content updates with IPNS

In my original post, I highlighted various challenges, such as the limitations for hosting dynamic applications, the cost of updates, and the slow speed of these updates. Although these issues still exist, my initial analysis was conducted with an incomplete understanding of the available technology. I want to delve deeper into these limitations, and refine my previous statements.

Some of these challenges stem from the fact that IPFS operates as a "content-addressed network". Unlike traditional systems that use URLs or file paths to locate content, IPFS uses a unique hash of the content itself. This hash is used to locate and verify the content, but also to facilitate decentralized storage.

While the principle of addressing content by a hash is super interesting, it also introduces some complications: whenever content is updated, its hash changes, making it tricky to link to the updated content. Specifically, every time I updated my Web3 site's content, I had to update my ENS record, and pay a translation fee on the Ethereum network.

At the time, I wasn't familiar with the InterPlanetary Name System (IPNS). IPNS, not to be confused with IPFS, addresses this challenge by assigning a mutable name to content on IPFS. You can think of IPNS as providing an "alias" or "redirect" for IPFS addresses: the IPNS address always stays the same and points to the latest IPFS address. It effectively eliminates the necessity of updating ENS records with each content change, cutting down on expenses and making the update process more automated and efficient.

To leverage IPNS, you have to take the following steps:

  1. Upload your HTML file to IPFS and receive an IPFS hash.
  2. Publish this hash to IPNS, creating an IPNS hash that directs to the latest IPFS hash.
  3. Link your ENS domain to this IPNS hash. Since the IPNS hash remains constant, you only need to update your ENS record once.

Without IPNS, updating content involved:

  1. Update the HTML file.
  2. Upload the revised file to IPFS, generating a new IPFS hash.
  3. Update the ENS record with the new IPFS hash, which costs some Ether and can take a few minutes.

With IPNS, updating content involves:

  1. Update the HTML file.
  2. Upload the revised file to IPFS, generating a new IPFS hash.
  3. Update the IPNS record to reference this new hash, which is free and almost instant.

Although IPNS is a faster and more cost-effective approach compared to the original method, it still carries a level of complexity. There is also a minor runtime delay due to the extra redirection step. However, I believe this tradeoff is worth it.

Updating my Web3 site to use IPNS

With this newfound knowledge, I decided to use IPNS for my own site. I generated an IPNS hash using both the IPFS desktop application (see screenshot) and IPFS' command line tools:

[code bash]$ ipfs name publish /ipfs/bafybeibbkhmln7o4ud6an4qk6bukcpri7nhiwv6pz6ygslgtsrey2c3o3q > Published to k51qzi5uqu5dgy8mzjtcqvgr388xjc58fwprededbb1fisq1kvl34sy4h2qu1a: /ipfs/bafybeibbkhmln7o4ud6an4qk6bukcpri7nhiwv6pz6ygslgtsrey2c3o3q[/code] The IPFS Desktop application showing my index.html file with an option to 'Publish to IPNS'.

After generating the IPNS hash, I was able to visit my site in Brave using the IPFS protocol at ipfs://bafybeibbkhmln7o4ud6an4qk6bukcpri7nhiwv6pz6ygslgtsrey2c3o3q, or via the IPNS protocol at ipns://k51qzi5uqu5dgy8mzjtcqvgr388xjc58fwprededbb1fisq1kvl34sy4h2qu1a.

My Web3 site in Brave using IPNS.

Next, I updated the ENS record for dries.eth to link to my IPNS hash. This change cost me 0.0011 ETH (currently $4.08 USD), as shown in the Etherscan transaction. Once the transaction was processed, dries.eth began directing to the new IPNS address.

A transaction confirmation on the ENS website, showing a successful update for dries.eth. Rolling back my IPNS record in ENS

Unfortunately, my excitement was short-lived. A day later, dries.eth stopped working. IPNS records, it turns out, need to be kept alive – a lesson learned the hard way.

While IPFS content can be persisted through "pinning", IPNS records require periodic "republishing" to remain active. Essentially, the network's Distributed Hash Table (DHT) may drop IPNS records after a certain amount of time, typically 24 hours. To prevent an IPNS record from being dropped, the owner must "republish" it before the DHT forgets it.

I found out that the pinning services I use – Dolphin, Fleek and Pinata – don't support IPNS republishing. Looking into it further, it turns out few IPFS providers do.

During my research, I discovered Filebase, a small Boston-based company with fewer than five employees that I hadn't come across before. Interestingly, they provide both IPFS pinning and IPNS republishing. However, to pin my existing HTML file and republish its IPNS hash, I had to subscribe to their service at a cost of $20 per month.

Faced with the challenge of keeping my IPNS hash active, I found myself at a crossroads: either fork out $20 a month for a service like Filebase that handles IPNS republishing for me, or take on the responsibility of running my own IPFS node.

Of course, the whole point of decentralized storage is that people run their own nodes. However, considering the scope of my project – a single HTML file – the effort of running a dedicated node seemed disproportionate. I'm also running my IPFS node on my personal laptop, which is not always online. Maybe one day I'll try setting up a dedicated IPFS node on a Raspberry Pi or similar setup.

Ultimately, I decided to switch my ENS record back to the original IPFS link. This change, documented in the Etherscan transaction, cost me 0.002 ETH (currently $6.88 USD).

Although IPNS works, or can work, it just didn't work for me. Despite the setback, the whole experience was a great learning journey.

(Update: A couple of days after publishing this blog post, someone kindly recommended https://dwebservices.xyz/, claiming their free tier includes IPNS republishing. Although I haven't personally tested it yet, a quick look at their about page suggests they might be a promising solution.)

Web3 remains too complex for most people

Over the past two years, Web3 hosting hasn't disrupted the mainstream website hosting market. Despite the allure of Web3, mainstream website hosting is simple, reliable, and meets the needs of nearly all users.

Despite a significant upgrade of the Ethereum network that reduced energy consumption by over 99% through its transition to a Proof of Stake (PoS) consensus mechanism, environmental considerations, especially the carbon footprint associated with blockchain technologies, continue to create further challenges for the widespread adoption of Web3 technologies. (Note: ENS operates on the blockchain but IPFS does not.)

As I went through the check-up, I discovered islands of innovation and progress. Wallets and ENS domains got easier to use. However, the overall process of creating a basic website with IPFS and ENS remains relatively complex compared to the simplicity of Web2 hosting.

The need for a SQL-compatible Web3 database

Modern web applications like those built with Drupal and WordPress rely on a technology stack that includes a file system, a domain name system (e.g. DNS), a database (e.g. MariaDB or MySQL), and a server-side runtime environment (e.g. PHP).

While IPFS and ENS offer decentralized alternatives for the first two, the equivalents for databases and runtime environments are less mature. This limits the types of applications that can easily move from Web2 to Web3.

A major breakthrough would be the development of a decentralized database that is compatible with SQL, but currently, this does not seem to exist. The complexity of ensuring data integrity and confidentiality across multiple nodes without a central authority, along with meeting the throughput demands of modern web applications, may be too complex to solve.

After all, blockchains, as decentralized databases, have been in development for over a decade, yet lack support for the SQL language and fall short in speed and efficiency required for dynamic websites.

The need for a distributed runtime

Another critical component for modern websites is the runtime environment, which executes the server-side logic of web applications. Traditionally, this has been the domain of PHP, Python, Node.js, Java, etc.

WebAssembly (WASM) could emerge as a potential solution. It could make for an interesting decentralized solution as WASM binaries can be hosted on IPFS.

However, when WASM runs on the client-side – i.e. in the browser – it can't deliver the full capabilities of a server-side environment. This limitation makes it challenging to fully replicate traditional web applications.

So for now, Web3's applications are quite limited. While it's possible to host static websites on IPFS, dynamic applications requiring database interactions and server-side processing are difficult to transition to Web3.

Bridging the gap between Web2 and Web3

In the short term, the most likely path forward is blending decentralized and traditional technologies. For example, a website could store its static files on IPFS while relying on traditional Web2 solutions for its dynamic features.

Looking to the future, initiatives like OrbitDB's peer-to-peer database, which integrates with IPFS, show promise. However, OrbitDB lacks compatibility with SQL, meaning applications would need to be redesigned rather than simply transferred.

Web3 site hosting remains niche

Even the task of hosting static websites, which don't need a database or server-side processing, is relatively niche within the Web3 ecosystem.

As I wrote in my original post: In its current state, IPFS and ENS offer limited value to most website owners, but tremendous value to a very narrow subset of all website owners.. This observation remains accurate today.

IPFS and ENS stand out for their strengths in censorship resistance and reliability. However, for the majority of users, the convenience and adequacy of Web2 for hosting static sites often outweigh these benefits.

The key to broader acceptance of new technologies, like Web3, hinges on either discovering new mass-market use cases or significantly enhancing the user experience for existing ones. Web3 has not found a universal application or surpassed Web2 in user experience.

The popularity of SaaS platforms underscores this point. They dominate not because they're the most resilient or robust options, but because they're the most convenient. Despite the benefits of resilience and autonomy offered by Web3, most individuals opt for less resilient but more convenient SaaS solutions.

Conclusion

Despite the billions invested in Web3 and notable progress, its use for website hosting still has significant limitations.

The main challenge for the Web3 community is to either develop new, broadly appealing applications or significantly improve the usability of existing technologies.

Website hosting falls into the category of existing use cases.

Unfortunately, Web3 remains mostly limited to static websites, as it does not yet offer robust alternatives to SQL databases and server-side runtime.

Even within the limited scope of static websites, improvements to the user experience have been marginal, focused on individual parts of the technology stack. The overall end-to-end experience remains complex.

Nonetheless, the fact that my Web3 page is still up and running after two years is encouraging, showing the robustness of the underlying technology, even if its current use remains limited. I've grown quite fond of IPFS, and I hope to do more useful experiments with it in the future.

All things considered, I don't see Web3 taking the website hosting world by storm any time soon. That said, over time, Web3 could become significantly more attractive and functional. All in all, keeping an eye on this space is definitely fun and worthwhile.

Kategorien: Drupal News

Dries Buytaert: Acquia a Leader in the 2024 Gartner Magic Quadrant for Digital Experience Platforms

Drupal News - Do, 03/14/2024 - 15:04

For the fifth year in a row, Acquia has been named a Leader in the Gartner Magic Quadrant for Digital Experience Platforms (DXP).

Acquia received this recognition from Gartner based on both the completeness of product vision and ability to execute.

Central to our vision and execution is a deep commitment to openness. Leveraging Drupal, Mautic and open APIs, we've built the most open DXP, empowering customers and partners to tailor our platform to their needs.

Our emphasis on openness extends to ensuring our solutions are accessible and inclusive, making them available to everyone. We also prioritize building trust through data security and compliance, integral to our philosophy of openness.

We're proud to be included in this report and thank our customers and partners for their support and collaboration.

Mandatory disclaimer from Gartner

Gartner, Magic Quadrant for Digital Experience Platforms, Irina Guseva, Jim Murphy, Mike Lowndes, John Field - February 21, 2024.

This graphic was published by Gartner, Inc. as part of a larger research document and should be evaluated in the context of the entire document. The Gartner document is available upon request from Acquia.

Gartner does not endorse any vendor, product or service depicted in its research publications, and does not advise technology users to select only those vendors with the highest ratings or other designation. Gartner research publications consist of the opinions of Gartner’s research organization and should not be construed as statements of fact. Gartner disclaims all warranties, expressed or implied, with respect to this research, including any warranties of merchantability or fitness for a particular purpose.

Gartner is a registered trademark and service mark of Gartner and Magic Quadrant is a registered trademark of Gartner, Inc. and/or its affiliates in the U.S. and internationally and are used herein with permission. All rights reserved.

Kategorien: Drupal News