Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Drupal 10 Module Development
  • Table Of Contents Toc
  • Feedback & Rating feedback
Drupal 10 Module Development

Drupal 10 Module Development

By : Sipos
4.7 (10)
close
close
Drupal 10 Module Development

Drupal 10 Module Development

4.7 (10)
By: Sipos

Overview of this book

Embark on a journey of Drupal module development with the latest edition of this must-have guide written by Daniel Sipos – a Drupal community member! This fourth edition is meticulously revised to cover the latest Drupal 10 enhancements that will help you build custom Drupal modules with an understanding of code deprecations, changing architecture, data modeling, multilingual ecosystem, and so on. You’ll begin with understanding the core components of Drupal 10 architecture, discovering its subsystems and unlocking the secrets of creating your first Drupal module. Further, you'll delve into Drupal logging and mailing systems, creating theme hooks, and rendering a layout. As you progress, you'll work with different types of data storage, custom entities, field types, and work with Database APIs for lower-level database queries. You'll learn to reap the power of JavaScript and ensure that your code works seamlessly on multilingual sites. You'll also learn to create custom views, automate tests for your functionalities, and write secure code for your Drupal apps. By the end of this book, you'll have gained confidence in developing complex modules that can solve even the most complex business problems and might even become a valuable contributor to the Drupal community!
Table of Contents (21 chapters)
close
close
3
Chapter 3: Logging and Mailing

Batch operations

To demonstrate how batching works, we are going to rebuild the way our product JsonImporter plugin processes the data it retrieves. Currently, we simply load all the values into an array of objects and loop through each, saving them to the database. So, if there are 100,000 products in the JSON response, we might get into trouble with this approach. To be fair, if the remote provider has so many products, it usually provides a paginated way of requesting them by passing an offset and a limit. This keeps the payloads smaller (which is good for both communicating servers) and makes processing easier. For now, we’ll go with the assumption that the number of returned products is large, but not so large as to pose problems with communication or with the ability of PHP to store them in memory.

Moreover, while illustrating the Batch API, we will also perform an operation we “forgot” in Chapter 7, Your Own Custom Entity and Plugin Types. During the...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY