Feeds

The Drop Times: Drupal 7 End of Life: What It Means and How to Move Forward

Planet Drupal - Tue, 2025-01-07 08:11
Drupal 7 has officially reached its End of Life as of January 5, 2025. Learn what this milestone means for the Drupal community, explore extended support options, and discover why migrating to modern platforms like Drupal 10 or 11 is essential for maintaining security and functionality.
Categories: FLOSS Project Planets

Thorsten Alteholz: My Debian Activities in December 2024

Planet Debian - Tue, 2025-01-07 07:29
Debian LTS

This was my hundred-twenty-sixth month that I did some work for the Debian LTS initiative, started by Raphael Hertzog at Freexian.

I worked on updates for ffmpeg and haproxy in all releases. Along the way I marked more CVEs as not-affected than I had to fix. So finally there was no upload needed for haproxy anymore. Unfortunately testing ffmpeg was not as easy, as the recommended “just look whether mpv can play random videos” is not really satisfying. So the upload will happen only in January.

I also wonder whether fixing glewlwyd is really worth the effort, as the software is already EOL upstream.

Debian ELTS

This month was the seventy-seventhth ELTS month. During my allocated time I worked on ffmpeg, haproxy, amanda and kmail-account-wizzard.

Like LTS, all CVEs of haproxy and some of ffmpeg could be marked as not-affected and testing of the other packages was/is not really straight forward. So the final upload will only happen in January as well.

Debian Printing

Unfortunately I didn’t found any time to work on this topic.

Debian Matomo

Thanks a lot to William Desportes for all fixes of my bad PHP packaging.

Debian Astro

This month I uploaded new packages or new upstream or bugfix versions of:

I again sponsored an upload of calceph.

Debian IoT

This month I uploaded new upstream or bugfix versions of:

Debian Mobcom

This month I uploaded new packages or new upstream or bugfix versions of:

misc

This month I uploaded new upstream or bugfix versions of:

I also sponsored uploads of emacs-lsp-docker, emacs-dape, emacs-oauth2, gpgmngr, libjs-jush.

FTP master

This month I accepted 330 and rejected 13 packages. The overall number of packages that got accepted was 335.

Categories: FLOSS Project Planets

Enrico Zini: Debugging printing to a remote printer

Planet Debian - Tue, 2025-01-07 06:40

I upgraded to Debian testing/trixie, and my network printer stopped appearing in print dialogs. These are notes from the debugging session.

Check firewall configuration

I tried out kde, which installed plasma-firewall, which installed firewalld, which closed by default the ports used for printing.

For extra fun, appindicators are not working in Gnome and so firewall-applet is currently useless, although one can run firewall-config manually, or use the command line that might be more user friendly than the UI.

Step 1: change the zone for the home wifi to "Home":

firewall-cmd --zone home --list-interfaces firewall-cmd --zone home --add-interface wlp1s0

Step 2: make sure the home zone can print:

firewall-cmd --zone home --list-services firewall-cmd --zone home --add-service=ipp firewall-cmd --zone home --add-service=ipp-client firewall-cmd --zone home --add-service=mdns

I searched and searched but I could not find out whether ipp is needed, ipp-client is needed, or both are needed.

Check if avahi can see the printer

Is the printer advertised correctly over mdns?

When it didn't work:

$ avahi-browse -avrt = wlp1s0 IPv6 Brother HL-2030 series @ server UNIX Printer local hostname = [server.local] address = [...ipv6 address...] port = [0] txt = [] = wlp1s0 IPv4 Brother HL-2030 series @ server UNIX Printer local hostname = [server.local] address = [...ipv4 address...] port = [0] txt = [] $ avahi-browse -rt _ipp._tcp [empty]

When it works:

$ avahi-browse -avrt = wlp1s0 IPv6 Brother HL-2030 series @ server Secure Internet Printer local hostname = [server.local] address = [...ipv6 address...] port = [631] txt = ["printer-type=0x1046" "printer-state=3" "Copies=T" "TLS=1.2" "UUID=…" "URF=DM3" "pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster,image/urf" "product=(HL-2030 series)" "priority=0" "note=" "adminurl=https://server.local.:631/printers/Brother_HL-2030_series" "ty=Brother HL-2030 series, using brlaser v6" "rp=printers/Brother_HL-2030_series" "qtotal=1" "txtvers=1"] = wlp1s0 IPv6 Brother HL-2030 series @ server UNIX Printer local hostname = [server.local] address = [...ipv6 address...] port = [0] txt = [] = wlp1s0 IPv4 Brother HL-2030 series @ server Secure Internet Printer local hostname = [server.local] address = [...ipv4 address...] port = [631] txt = ["printer-type=0x1046" "printer-state=3" "Copies=T" "TLS=1.2" "UUID=…" "URF=DM3" "pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster,image/urf" "product=(HL-2030 series)" "priority=0" "note=" "adminurl=https://server.local.:631/printers/Brother_HL-2030_series" "ty=Brother HL-2030 series, using brlaser v6" "rp=printers/Brother_HL-2030_series" "qtotal=1" "txtvers=1"] = wlp1s0 IPv4 Brother HL-2030 series @ server UNIX Printer local hostname = [server.local] address = [...ipv4 address...] port = [0] txt = [] $ avahi-browse -rt _ipp._tcp + wlp1s0 IPv6 Brother HL-2030 series @ server Internet Printer local + wlp1s0 IPv4 Brother HL-2030 series @ server Internet Printer local = wlp1s0 IPv4 Brother HL-2030 series @ server Internet Printer local hostname = [server.local] address = [...ipv4 address...] port = [631] txt = ["printer-type=0x1046" "printer-state=3" "Copies=T" "TLS=1.2" "UUID=…" "URF=DM3" "pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster,image/urf" "product=(HL-2030 series)" "priority=0" "note=" "adminurl=https://server.local.:631/printers/Brother_HL-2030_series" "ty=Brother HL-2030 series, using brlaser v6" "rp=printers/Brother_HL-2030_series" "qtotal=1" "txtvers=1"] = wlp1s0 IPv6 Brother HL-2030 series @ server Internet Printer local hostname = [server.local]https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1092109 address = [...ipv6 address...] port = [631] txt = ["printer-type=0x1046" "printer-state=3" "Copies=T" "TLS=1.2" "UUID=…" "URF=DM3" "pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster,image/urf" "product=(HL-2030 series)" "priority=0" "note=" "adminurl=https://server.local.:631/printers/Brother_HL-2030_series" "ty=Brother HL-2030 series, using brlaser v6" "rp=printers/Brother_HL-2030_series" "qtotal=1" "txtvers=1"] Check if cups can see the printer

From CUPS' Using Network Printers:

$ /usr/sbin/lpinfo --include-schemes dnssd -v network dnssd://Brother%20HL-2030%20series%20%40%20server._ipp._tcp.local/cups?uuid=… Debugging session interrupted

At this point, the printer appeared.

It could be that:

In the end, debugging failed successfully, and this log now remains as a reference for possible further issues.

Categories: FLOSS Project Planets

Specbee: Why you can’t afford to stay on Drupal 7 any longer

Planet Drupal - Tue, 2025-01-07 03:09
Drupal 7 is officially retired. Staying on this outdated platform could expose your site to security threats, performance issues, and increased costs. Find out why upgrading to Drupal 10 is crucial now.
Categories: FLOSS Project Planets

Kwave Nightly Flatpak

Planet KDE - Mon, 2025-01-06 23:25
Kwave Nightly Flatpak

If you want to keep up with the latest Kwave updates, you can now try out the nightly flatpak. It gets published each time code is pushed to the master branch, so it may sometimes have bugs, but also new features. To try it out, add the repository by running flatpak remote-add kwave-nightly https://cdn.kde.org/flatpak/kwave-nightly/kwave-nightly.flatpakrepo and install Kwave with flatpak install kwave-nightly org.kde.kwave. If you use Discover, go to Settings, click Add Source and paste https://cdn.kde.org/flatpak/kwave-nightly/kwave-nightly.flatpakrepo in to add the repo, and then search for Kwave.

The process for publishing stable versions to Flathub has also started. The current plan is to wait for the next stable version (25.04) to publish Kwave on Flathub.

Categories: FLOSS Project Planets

Talking Drupal: Talking Drupal #483 - Meet your host: Nic Laflin

Planet Drupal - Mon, 2025-01-06 15:00

On today's show we are talking with Nic. This is our chance to learn more about our beloved Talking Drupal show host.

For show notes visit: https://www.talkingDrupal.com/XXX

Topics
  • Talking Drupal
  • NLightened Development
  • Contribution
  • Personal Background
  • Interests
  • Drupal
Guests

Nic Laflin - nLighteneddevelopment.com nicxvan

Hosts

Stephen Cross-@stephencross

Categories: FLOSS Project Planets

The Drop Times: End of an Era

Planet Drupal - Mon, 2025-01-06 10:53

January 5, 2025, marks the end of an era in web development— Drupal 7's final End of Life (EOL). Since its release in early 2011, Drupal 7 has reigned as the most widely used version of Drupal worldwide, powering millions of websites and leaving a lasting legacy in the open-source community. 

With over 14 years of service, Drupal 7 demonstrated exceptional stability and flexibility. It introduced game-changing features like the Entity API, Views in core, and a modernized admin interface that appealed to developers and content creators alike. These advancements enabled users to build everything from personal blogs to enterprise-grade websites with ease.

Drupal 7's reach was unmatched. At its peak, it powered over 1.3 million websites, including high-profile organizations, educational institutions, and government platforms. Its vibrant community of contributors and extensive library of contributed modules made it a powerhouse for innovation and customization.

However, as technology evolved, the Drupal ecosystem shifted toward a more modern architecture. While Drupal 8 and subsequent versions introduced significant advancements, the transition required a complete reimagining of how Drupal sites were built, leaving Drupal 7’s legacy to shine as a testament to its time.

Now, as Drupal 7 officially bows out, it leaves us with a sense of pride for its role in shaping the web as we know it. This milestone coincides with the anticipation surrounding the launch of the Drupal CMS, signaling an exciting new chapter for the community.

To all who have built, maintained, and relied on Drupal 7, we thank you for being part of its incredible journey. Its impact will not be forgotten.

Let's have a look the important stories from the past week.

   Interview    PHP

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

Thank you, 
Sincerely 
Thomas Alias K 
Sub-editor, The DropTimes.

Categories: FLOSS Project Planets

The Drop Times: Building a Schema.org-First Future with the Schema.org Blueprints Module for Drupal

Planet Drupal - Mon, 2025-01-06 09:11
Jacob Rockowitz, creator of the Schema.org Blueprints module, discusses how it empowers organizations to build API-first, SEO-friendly websites using Schema.org’s standardized content models. He shares insights into the module’s development, its integration with Drupal, and his vision for a Schema.org-first approach to content modeling.
Categories: FLOSS Project Planets

Real Python: Iterators and Iterables in Python: Run Efficient Iterations

Planet Python - Mon, 2025-01-06 09:00

Understanding iterators and iterables in Python is crucial for running efficient iterations. Iterators control loops, allowing you to traverse arbitrary data containers one item at a time. Iterables, on the other hand, provide the data that you want to iterate over. By mastering these concepts, you can create robust code that handles data efficiently, even when working with large datasets or infinite data streams.

This tutorial covers creating iterators using the iterator protocol, differentiating iterators from iterables, and using generator functions and the yield statement to create generator iterators. You’ll also learn how to build custom iterables using various techniques, including the iterable protocol, and how to write asynchronous iterators using the asyncio module.

By the end of this tutorial, you’ll understand that:

  • Python iterators are objects with .__iter__() and .__next__() methods.
  • Iterables are objects that can return an iterator using the .__iter__() method.
  • Generator functions use the yield statement to create generator iterators.
  • Asynchronous iterators use .__aiter__() and .__anext__() for async operations.
  • Iterators are memory-efficient and can handle infinite data streams.

Before diving deeper into these topics, you should be familiar with some core concepts like loops and iteration, object-oriented programming, inheritance, special methods, and asynchronous programming in Python.

Free Sample Code: Click here to download the free sample code that shows you how to use and create iterators and iterables for more efficient data processing.

Take the Quiz: Test your knowledge with our interactive “Iterators and Iterables in Python: Run Efficient Iterations” quiz. You’ll receive a score upon completion to help you track your learning progress:

Interactive Quiz

Iterators and Iterables in Python: Run Efficient Iterations

In this quiz, you'll test your understanding of Python's iterators and iterables. By working through this quiz, you'll revisit how to create and work with iterators and iterables, the differences between them, and review how to use generator functions.

Understanding Iteration in Python

When writing computer programs, you often need to repeat a given piece of code multiple times. To do this, you can follow one of the following approaches:

  • Repeating the target code as many times as you need in a sequence
  • Putting the target code in a loop that runs as many times as you need

The first approach has a few drawbacks. The most troublesome issue is the repetitive code itself, which is hard to maintain and not scalable. For example, the following code will print a greeting message on your screen three times:

Python greeting.py print("Hello!") print("Hello!") print("Hello!") Copied!

If you run this script, then you’ll get 'Hello!' printed on your screen three times. This code works. However, what if you decide to update your code to print 'Hello, World!' instead of just 'Hello!'? In that case, you’ll have to update the greeting message three times, which is a maintenance burden.

Now imagine a similar situation but with a larger and more complex piece of code. It can become a nightmare for maintainers.

Using a loop will be a much better way to solve the problem and avoid the maintainability issue. Loops allow you to run a piece of code as often as you need. Consider how you’d write the above example using a while loop:

Python >>> times = 0 >>> while times < 3: ... print("Hello!") ... times += 1 ... Hello! Hello! Hello! Copied!

This while loop runs as long as the loop-continuation condition (times < 3) remains true. In each iteration, the loop prints your greeting message and increments the control variable, times. Now, if you decide to update your message, then you just have to modify one line, which makes your code way more maintainable.

Python’s while loop supports what’s known as indefinite iteration, which means executing the same block of code over and over again, a potentially undefined number of times.

You’ll also find a different but similar type of iteration known as definite iteration, which means going through the same code a predefined number of times. This kind of iteration is especially useful when you need to iterate over the items of a data stream one by one in a loop.

To run an iteration like this, you typically use a for loop in Python:

Python >>> numbers = [1, 2, 3, 4, 5] >>> for number in numbers: ... print(number) ... 1 2 3 4 5 Copied!

In this example, the numbers list represents your stream of data, which you’ll generically refer to as an iterable because you can iterate over it, as you’ll learn later in this tutorial. The loop goes over each value in numbers and prints it to your screen.

When you use a while or for loop to repeat a piece of code several times, you’re actually running an iteration. That’s the name given to the process itself.

In Python, if your iteration process requires going through the values or items in a data collection one item at a time, then you’ll need another piece to complete the puzzle. You’ll need an iterator.

Getting to Know Python Iterators Read the full article at https://realpython.com/python-iterators-iterables/ »

[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

Categories: FLOSS Project Planets

1xINTERNET blog: Get Hands-On with the Drupal CMS – No Technical Skills Needed!

Planet Drupal - Mon, 2025-01-06 07:00

Experience the much anticipated new Drupal CMS by testing the Release Candidate now—whether you're a developer, marketer, content editor or designer there's now an option for you too!

Categories: FLOSS Project Planets

Golems GABB: Drupal ECA module and integration with Drupal Commerce

Planet Drupal - Mon, 2025-01-06 03:10
Drupal ECA module and integration with Drupal Commerce Editor Mon, 01/06/2025 - 10:10

Drupal is incredibly flexible and scalable. Thanks to this, you can ensure the efficient operation of websites, personal online blogs, web applications, and other online projects.
That's where the latest Drupal ECA module comes into play. It can be easily adapted to Drupal e-commerce and takes advantage of the vast possibilities of collaboration.
Wouldn't it be great if your Drupal website could respond to events in a personalized way? One of the ideas is sending a special discount after a customer's fifth purchase or automatically adjusting stock levels when a product is added to a cart. That's where the ECA module comes in! It's a powerful Drupal module that lets you create custom "rules" for your site based on triggers, checks, and results.

Categories: FLOSS Project Planets

LN Webworks: How to Set Up the OpenAI Module in Drupal 10

Planet Drupal - Mon, 2025-01-06 02:43

For your Drupal website, the OpenAI module is a sophisticated solution that supports a wide range of OpenAI/ChatGPT functionalities. It has an API basis for smooth integration and an amazing collection of submodules.

Notably, the module was among the first to use ChatGPT for Drupal, with its initial release being in January 2023. The module is called OpenAI / ChatGPT / AI Search Integration in its entirety. Although it is still in the alpha stage, it is being developed constantly from the best drupal development company. It won't function on older versions of Drupal because it was made especially for Drupal 10, the most recent major version. 

Submodules Of OpenAI Module In Drupal

Here are some of the submodules included:

Categories: FLOSS Project Planets

Zato Blog: Getting started with network automation in Python

Planet Python - Mon, 2025-01-06 02:42
Getting started with network automation in Python 2025-01-07, by Dariusz Suchojad

All network engineers and architects understand that automation is essential for efficiency and reliability, especially with the increasing shift to cloud-based environments, where it's no longer sufficient to merely connect network elements alone, without taking the bigger IT picture into account.

The latest article about network automation will introduce you to a Python-based integration platform designed to automate network tasks, connect diverse systems, and manage complex workflows.

You'll see not only how to automate a network device, but also how to connect cloud applications outside of what a typical automation tool would do, including Jira for tickets and Microsoft 365 to manage email, all using basic Python code.

Read the article here: Network Automation in Python.

More resources

➤ Python API integration tutorial
What is a Network Packet Broker? How to automate networks in Python?
What is an integration platform?
Python Integration platform as a Service (iPaaS)
What is an Enterprise Service Bus (ESB)? What is SOA?
➤ Visit the support center for more articles and FAQ
Open-source iPaaS in Python

More blog posts
Categories: FLOSS Project Planets

Hotfix: KPhotoAlbum 6.0.1

Planet KDE - Sun, 2025-01-05 19:00

This is an extremely important update to our recently released KF6/Qt6 port of KPhotoAlbum!

There’s a bug in version 6.0.0 which, under some circumstances, can lead to data loss! The problem is that, during porting, the algorithm we use to escape category names to be able to use them as XML attributes broke. And we didn’t notice. This can lead to data loss when opening a database and saving it using version 6.0.0, provided the following conditions are met:

  • The “compressed” or “fast” XML format is used (“Choose speed over readability for the XML database file” is checked in the “Database Backend” settings)
  • At least one category exists whose name contains characters other than “a-z”, “A-Z”, “0-9”, “:” or “_”

In this case, all tag associations for tags from the affected category can’t be mapped correctly and are discarded when reading the datase – and lost when saving it.

I personally found this after having tagged about 400 photos using my actual photo database and later on having wondered where my “Schlagwörter” tags for the other 15,000 have gone. Happily, we have that XML format. So, with an older backup (of course, I saved the database so often that the automated backups already exceeded the maximum number and the last unaffected database backup was already gone …) and some copying and pasting in KWrite, I could recover the old tags.

Anyway, This is actually the worst case. It can’t be recovered automatically. Big sorry to everybody affected! This should not have happened. And we sincerely hope such a bug doesn’t ever slip through our fingers ever again.

However, the 6.0.1 release fixes this. So: please update right now if you already used version 6.0.0! If not, skip 6.0.0 and go directly to 6.0.1! Dear distributors:

Please remove version 6.0.0 and replace it with 6.0.1!

Other fixes

Some other bugs have also been fixed in this release:

  • Fix application icon on Wayland
  • Fix crash when video thumbnail cache contains empty files (fixes Bug #497831)
  • The "Configure KPhotoAlbum" menu entry is now shown again (not where it was before, but it’s there again – this alone would have justified a bugfix release ;-)
  • Clicking on a tag in the Viewer’s info box shows the respective tag in the browser again
  • When the main window is closed and the viewer is opened, it is also closed now automatically. This is what one would expect, and it also fixes crashing e.g. when the user clicks on an info box link with the main window already closed. Additionally, if the annotation dialog is open, we now also try to close it. If this doesn’t succeed (e.g. because there are pending changes and the user didn't agree to discard them) the close query is aborted.

Technically, this is not a pure bugfix release, because support for database file names other than index.xml has also been added (cf. Bug #418647). But this does not interfere with anything and does not change current behavior. So let’s also declare this as a bugfix, for “The XML database name is hard-coded and should not be” ;-)

Sorry again for all inconveniences version 6.0.0 may have caused. We sincerely hope that everybody affected by data loss can restore everything so that none of the hard work put into your photo databases is actually permanently lost.

— Tobias

Categories: FLOSS Project Planets

KDE Plasma 5.27.12, Bugfix Release for January

Planet KDE - Sun, 2025-01-05 19:00

Monday, 6 January 2025. Today KDE releases a bugfix update to KDE Plasma 5, versioned 5.27.12.

Plasma 5.27 was released in February 2023 with many feature refinements and new modules to complete the desktop experience.

The bugfixes are typically small but important and include:

  • Lookandfeel: Explicitly set theme to Breeze in defaults. Commit.
  • Applets/battery: Check actual battery for charge state workaround. Commit.
  • Weather/dwd: don't crash on empty json objects. Commit. Fixes bug #481596
View full changelog
Categories: FLOSS Project Planets

Event Organizers: Event Organizers - 2024 Year in Review

Planet Drupal - Sun, 2025-01-05 18:00

The Event Organizer Working Group marked two major milestones in 2024. First, it’s been 5 years since our charter was established in 2019. Second, 2024 is the final year of service for the last two of our founding board members.

Community events have changed drastically in this relatively short period, but our mission has not.

The Event Organizers Working Group supports community-led teams to grow Drupal through local events. Our vision is to establish a worldwide network of Drupal experts who organize events and aid one another to do the same.

This year, the group has focused on three major initiatives - growing our central source for promoting community events, building a reusable platform for running community events, and continuing to get the word out about our resources.

Redesigning /community/events

Launched in 2020, the Drupal Community Events page is intended to serve as a consolidated listing of Drupal events across the world to facilitate promotion, encourage collaboration, and give the community more data about what’s happening in the space.

In 2024, almost 300 events were posted in over 30 countries, bringing the total number of events posted in 4 years to over 1100! We saw a surge in Local Meetup postings, with many events shifting their postings from other platforms.

Download a PDF of this data and events broken down by country.

At DrupalCon Pittsburgh 2023, we began an effort to refine the display of the Drupal Community Events listing - the data was good, but the display had become cluttered.

During Drupalcon we iterated on some ideas but lost momentum during the post-DrupalCon/summer slump. With support from b_man and drumm, we were given access to a Drupal.org dev environment and were able to mock up changes to /community/events’ Panels and styles. These changes consolidated the page into a single list of events, with a legend providing access to events filtered by type.

At DrupalCon Portland 2024, we gathered our forces once again and completed a review of the changes. The Drupal Association team committed them soon after. Community members are welcome to review the new design for /community/events and share any other feedback you might have on the meta-issue.

Iterating on the Events Platform

After a major development push in 2023, the Events Platform continues to move forward thanks to mandclu. Two minor releases have been pushed this year, including one major minor that introduces Drupal 11 support! Martin did a presentation on the Events Platform at the DrupalCon Portland 2024 Community Summit and documentation has also been greatly improved.

DrupalCamp NJ and PNW Drupal Summit both spun up new sites with the platform, as did DrupalCamp Berlin, who also wrote up a fantastic blog post about their build. If you know of another site using the Events Platform, please let us know.

Connecting Event Organizers

We’ve continued making connections between event organizers virtually and in person. Our monthly open meeting via Slack on the 2nd Tuesday of the month starting at 16:00 UTC / 12:00 pm ET (listed on a Google Calendar) has been a great way for organizers to share information and catch up on what’s going on.

Other ways to get in touch:

Looking forward

With leslieg and I (froboy) rolling off the board after two full terms and a new slate of board members and advisors joining, the EOWG has a bright future ahead of it. Volunteer-driven events need all the support we can give them in the best of times, and the power of community continues to drive the Drupal project forward.

Thanks to everyone participating in Drupal community events and the Event Organizer Working Group this year. We’re all important in keeping “... stay for the community” alive.

File attachments:  2024 Events by type.png EOWG 2024 Year in Review - Pie chart 1 - Pie.pdf
Categories: FLOSS Project Planets

#! code: Drupal 11: Using Data Transfer Objects With The Queue API

Planet Drupal - Sun, 2025-01-05 13:45

When writing data to the queue database system Drupal will convert the information to a string using the PHP serialize() function. When the information is pulled out of the database the queue system will unserialize() the data to convert it back into the original information.

When you first start using the queue system you will probably use an array or the PHP stdClass object to store the information on your queue. Whilst this works, the information they contain is pretty free form and makes testing or working with the data a little cumbersome.

A much better way of storing data is by creating an object of a known type and using that as the storage medium for the queue.

This technique of using an object to pass data around different parts of your system is known as Data Transfer Objects (DTO). This allows you to present data in a unified way across your application. This is a design pattern that standardizes how a particular bit of data is passed around, without having to resort to using arrays to accomplish the same job.

In this article we will look at creating a DTO for use in the queue API in Drupal, and how the use of DTOs can protect our queue processing from errors by rejecting items from the queue.

All of the code seen in this article is available on the accompanying GitHub repository that shows a few examples of running the Queue API in Drupal.

Creating A DTO

A DTO in PHP is just a normal class, the key difference is that we use the readonly class (since PHP 8.2) syntax, which means that all properties can only be written once (in the constructor). We do this to prevent the data in the object from being altered after it is created.

It is generally a good idea to create interfaces for our objects so that we can check to make sure that

Read more

Categories: FLOSS Project Planets

Dominique Dumont: cme: new field in fill.copyright.blanks.yml for Debian copyright file

Planet Debian - Sun, 2025-01-05 12:09

Hi

The file fill.copyright.blanks.yml is used to fill missing copyright information when running cme update dpkg-copyright. This file can contain a comment field that is used for book-keeping.

Here’s an example from libuv1:

README.md: comment: |- the license from this file is used as a main license and tends to apply expat or CC to all files. Which is wrong. Let's skip this file and let cme retrieve data from files. skip: true

You may ask: why no use a YAML comments ? The problem is that YAML comments are dropped by cme edit dpkg. So you should not use them in fill.copyrights.blanks.yml.

It occurred to me that it may be interesting to copy the content of this comment in to debian/copyright file entries. But not in all cases, as some comments make sense in fill.copyright.blanks.yml but not in debian/copyright.

So I’ve added a new forwarded-comment parameter in fill.copyright.blanks.yml. The content of this field is copied verbatim in debian/copyright.

This way, you can add comments for book keeping and comments for debian/copyright entries.

For instance:

pan/gui/*: forwarded-comment: some comment about gui comment: this is an example from cme test files

yields:

Files: pan/gui/* Copyright: 1989, 1991, Free Software Foundation, Inc. License: GPL-2 Comment: some comment about gui

This new functionality is available in libconfig-model-dpkg-perl >= 3.008.

All the best

Categories: FLOSS Project Planets

Pages