Batch processing is usually an important aspect of any Drupal project and even more when we need to process huge amounts of data.
The main advantage of using batch is that it allows large amounts of data to be processed into small chunks or page requests that run without any manual intervention. Rather than use a single page load to process lots of data, the batch API allows the data to be processed as number of small page requests.
Queues are particularly important when we need to stash some tasks for later processing. To do so, we are going to put some tasks or data in a queue (create the queue) and later we will process those tasks with a QueueWorker plugin (process the queue), usually triggered by cron.
Creating forms is part of the day to day live of a Drupal programmer. Forms are represented as nested arrays in both Drupal 7 and Drupal 8. But they are different in that in Drupal 7 you define your form arrays in functions and in Drupal 8 you create a form class.
In this post we’ll create a custom form with two fields, a text field and a checkbox field, we’ll validate those fields, display them in a message and finally redirect the user to the home page.
You can find the code of this module here.
In Drupal 7, to manage system variables, we used variable_get() / variable_set() / variable_del() calls and stored those variables in the variable table of the database.
(c) 2018 - Karim Boudjema - Made in Bolivia with Drupal 8