Building Decoupled Drupal Applications with GraphQL

Decoupled Drupal is a popular approach to building web applications that separates the content management system (CMS) from the front-end user interface. This allows for greater flexibility and scalability in the development process, as well as the ability to use different front-end technologies for different parts of the application.

One popular way to implement decoupled Drupal is by using GraphQL, a query language for APIs that provides a more efficient, powerful, and flexible alternative to RESTful APIs. In this article, we'll explore how to build a decoupled Drupal application with GraphQL, using Drupal as the CMS and React as the front-end framework.

Step 1: Set Up Your Drupal Environment

The first step in building a decoupled Drupal application with GraphQL is to set up your Drupal environment. This will involve installing Drupal and configuring it to expose your content as a GraphQL API.

To do this, you can use the Drupal GraphQL module, which provides a plugin system for extending the GraphQL schema with custom types, fields, and queries. Once you've installed and enabled the module, you can define your custom types and fields using the Drupal hook system.

Here's an example of defining a custom GraphQL type in Drupal:

This code defines a custom GraphQL type called "Article" with fields for the title, body, and image of the article. The resolve function for the field_image field uses the Drupal ImageStyle service to generate a URL for the image based on the specified image style.

Step 2: Set Up Your React Environment

Once you've set up your Drupal environment, the next step is to set up your React environment. This will involve creating a new React application and installing the necessary dependencies.

To create a new React application, you can use the Create React App tool, which provides a simple way to set up a new React project with all the necessary configuration and dependencies. Here's an example of creating a new React application:

npx create-react-app my-app
cd my-app

Next, you'll need to install the necessary dependencies for working with GraphQL in React. For this, we'll be using the Apollo Client library, which provides a convenient way to query GraphQL APIs and manage the resulting data.

To install Apollo Client, you can run the following command:

npm install @apollo

Step 3: Connect to the GraphQL API

Once you've set up your Drupal and React environments, the next step is to connect to the Drupal GraphQL API from your React application. To do this, you'll need to create an instance of the Apollo Client and configure it with the URL of your GraphQL endpoint.

Here's an example of setting up the Apollo Client in a React component:

This code creates a new Apollo Client instance and configures it with the URL of your Drupal GraphQL endpoint.

Step 4: Query the GraphQL API

Once you've connected to the Drupal GraphQL API from your React application, the next step is to query the API for the data you need. To do this, you can use the useQuery hook provided by Apollo Client, which allows you to define your query as a GraphQL string and execute it against the API.

Here's an example of querying the Drupal GraphQL API for a list of articles:

This code defines a GraphQL query for fetching a list of articles from Drupal, using the nodeQuery field provided by the Drupal GraphQL module. The resulting data is then rendered as a list of articles in a React component.

Step 5: Display the Data

Finally, once you've queried the Drupal GraphQL API for the data you need, the last step is to display the data in your React application. This will involve rendering the data in your components using JSX, the declarative syntax used by React for describing user interfaces.

Here's an example of rendering the list of articles fetched from Drupal in a React component:

This code renders a list of articles fetched from Drupal in a React component, using conditional rendering to handle the loading and error states of the data.

Ready to build your own decoupled Drupal application with GraphQL? Contact us to learn how our expert team of developers can help you bring your ideas to life.

Developing Custom Drupal Modules Using Object-Oriented Programming

Drupal is a popular content management system (CMS) that is widely used to build complex websites and web applications. One of the main advantages of Drupal is its modular architecture, which allows developers to extend and customize its functionality by creating custom modules.

In this article, we'll explore how to develop custom Drupal modules using object-oriented programming (OOP) principles. By using OOP, we can create more maintainable, reusable, and testable code that is easier to understand and modify.

Step 1: Set up your Drupal environment

Before we can start developing custom modules, we need to set up a local development environment for Drupal. This typically involves installing a web server, a database server, and a Drupal distribution on your local machine. 
Here's a high-level overview of the steps involved in setting up a local Drupal environment:

  1. Install a web server such as Apache or Nginx
  2. Install a database server such as MySQL or PostgreSQL
  3. Install PHP and its required extensions
  4. Download and extract the latest version of Drupal from drupal.org
  5. Create a new database for your Drupal installation
  6. Run the Drupal installer and configure your site settings

Step 2: Create a new Drupal module

Once you have set up your Drupal environment, the next step is to create a new Drupal module. In Drupal, a module is a collection of files that provide additional functionality to your site.

To create a new Drupal module, you need to create a new directory in the "modules" folder of your Drupal installation and create a new "MODULE_NAME.info.yml" file and a "MODULE_NAME.module" file inside that directory.

Here's an example of creating a new Drupal module called "my_module":

  1. Create a new directory called "my_module" in the "modules" folder of your Drupal installation
  2. Create a new file called "my_module.info.yml" inside the "my_module" directory with the following contents: 

This file defines the basic metadata for your module, including its name, description, type, and compatibility with Drupal 8 and 9.

 3. Create a new file called "my_module.module" inside the "my_module" directory with the following contents:

This file defines a custom menu item for your module and a page callback function that returns a simple message.

Step 3: Use object-oriented programming (OOP) principles

Now that we have a basic Drupal module set up, the next step is to start using OOP principles to create more maintainable and reusable code.

In Drupal, OOP is primarily used in the creation of classes and interfaces, which provide a way to organize and encapsulate code into logical units that can be reused across your module and even other modules.

Here's an example of using OOP to create a custom service for our "my_module" module:

  1. Create a new file called "src/MyModuleService.php" inside the "my_module" directory with the following contents:

This file defines a custom service class for our "my_module" module that returns a custom message.

  2. Update the "my_module_page()" function in the "my_module.module" file to use our new service:

This code retrieves an instance of our custom service using the Drupal service container and uses it to render the content of our page.

Step 4: Test and debug your module

Once you have developed your custom Drupal module using OOP principles, it's important to thoroughly test and debug it to ensure that it works as expected and doesn't introduce any bugs or security vulnerabilities into your site.

To test and debug your Drupal module, you can use a variety of tools and techniques, including:

  • Unit tests: Write automated tests for your module's functionality using PHPUnit or other testing frameworks.
  • Debugging tools: Use Drupal's built-in debugging tools, such as the Devel module, to debug your module's code and inspect its variables and data structures.
  • Code review: Have other developers review your code to identify potential issues and suggest improvements.

Conclusion

In this article, we've explored how to develop custom Drupal modules using object-oriented programming principles. By using OOP, we can create more maintainable, reusable, and testable code that is easier to understand and modify. We've also seen how to use OOP to create custom services and how to test and debug our custom Drupal modules. With these techniques, you can create powerful and flexible Drupal applications that meet your specific needs.

How to Add Dependency Injection in a Controller in Drupal 9

Dependency Injection is a design pattern that helps decouple the different components of a software application. It is a software design pattern that helps to manage the dependencies between different components in a software system. It involves passing the required dependencies into a class, rather than letting the class create or locate them itself. 

This pattern makes writing reusable, testable, and maintainable code easier. Decoupling the components of a system makes it easy to change or update any one component without affecting the others. In this blog, I will outline the process of creating and utilizing a custom service in Drupal 9 through dependency injection. 

Dependency injection is a technique where a client object relies on an injected object. It facilitates the flow of data between the two objects and enhances the overall modularity, testability, and scalability of the application. 

Dependency Injection has several benefits, such as: 

  • Improved maintainability: Dependency Injection makes it easier to change or update components without affecting the rest of the system.
  • Increased flexibility: Different components can be easily swapped out and replaced with others, which can be especially useful for testing.
  • Better scalability: Dependency Injection allows new components to be added easily as the application grows.

Dependency Injection can be implemented in different ways, such as using a constructor, a setter method, or an interface. The choice of method depends on the requirements of the specific use case, but the overall goal is to make the dependencies explicit and manageable.

Implementing Dependency Injection in Drupal 9

Recently, I have been working with services and dependency injection in Drupal 9. This process is similar to what was used in Drupal 8. Dependency injection provides a major advantage as it eliminates the need to constantly call the global container. Instead, we can simply inject the required services and events through dependency injection.

Services in Drupal 9 can be created using custom modules and can then be utilized on pages, controllers, blocks, and other components by using dependency injection.

In the below example, I have explained the connection between services and dependency injection in Drupal 9. I will also talk about how to call a custom service, which lists nodes based on the user ID passed in the URL, within a custom controller using dependency injection.

Services are used to reuse functionality such as database-related queries or sending emails. By using services, the same functionality can be utilized throughout the site after being defined in a single service file.

Step-Wise Guide on How to Add Dependency Injection in a Controller in Drupal 9

Let us go step by step to implement a service and invoke it via Dependency Injection in a Controller.

Step 1 - Establish a Custom Module within the Appropriate Directory

The first step is to create a custom module within the designated directory. This module should include an info.yml file that outlines the name and relevant details of the custom module.

 

Step 2 - Implement a Custom Service for Retrieving Node List Based on  User ID

To proceed, we will add a module_services.yml file, as illustrated in the image below. Within this file, we will specify the service class and its dependencies, such as the database argument in this case, as it involves querying the database to obtain the node list.

Next, we will place the service file within the designated directory, as follows:

/modules/custom/custom_service/src/GetDataServices.php

This is the location of the custom service file, which in this case is named GetDataServices.php and resides within the src folder of the custom module.

Step 3 - Integrate the Controller and Router within the Custom Module

This step involves adding the necessary code to the controller, which allows us to utilize the service from within the controller. The following code demonstrates this implementation.

The central aspect of this implementation is the utilization of the $container object, which offers a single method, "Get", as follows:

$container->get('');

To commence, we will declare a variable, referred to as $nodedata.

Subsequently, we set the value of $container with the following line:

$container->get('custom_service.get_data_user_node')

This specifies the name of our custom service, custom_service.get_data_user_node, which will be instantiated in the backend.

To access any function within the custom service, we first need to retrieve it using the following line:

 

$service = \Drupal::service('custom_service.get_data_user_node');

But we are calling the Dependency injection so we just inject our service like : $this->nodeData.

Finally, we can call the desired function, in this case the, "drupalise($id)" function, by using the following line:

$all_node = $this->nodeData->drupalise($id);

This function, "drupalise($id)," retrieves the node list based on the User ID argument passed.

Step 4 - Verifying the Controller Routing Page

The routing page of the controller can be accessed by passing the User ID in the URL. The data related to the user ID will be displayed on the page. The functionality of the page, such as filters and sorting, can be enhanced by adding the necessary code in the service file.

In this instance (Fig. 1), a simple listing query has been included and the result is presented in a tabular format with headers and rows. The controller function returns this table with the listing of Uid : Node id of that user, Title , and Node Type.

Dependency Injection Drupal 9

This serves as an illustration of how to access the first service from the container in Drupal 9 using dependency injection. This approach can be applied to call both Drupal core services and custom services.

Conclusion

To take advantage of the full capabilities of the Drupal 9 platform and to simplify your custom module development process, you should consider utilizing dependency injection in your controllers.

This approach allows you to leverage the power of custom services and streamline the integration of your desired functionality into your website.

If you are looking to improve your Drupal application’s performance and efficiency, or Drupal development needs, reach out to us



Drupal 9 End is Near: Upgrade with Dependency Injection to Drupal 10!

 

How to Conduct a Drupal Security Audit: Summary of Modules and Libraries

Drupal Security Audit is a systematic evaluation performed by authorized individuals or teams or tools to identify potential security weaknesses in a system or website. The audit encompasses a comprehensive range of activities, including code analysis of the core, plugins, and modules, configuration assessments, evaluations of business logic errors, and more. The goal of the audit is to identify any vulnerabilities and provide recommendations for remediation to ensure the website's security.

Importance of Undertaking Drupal Security Audit and Penetration Testing

Drupal sites are susceptible to threats such as Cross-Site Scripting (XSS), Denial of Service (DoS), Code Execution, SQL Injection, HTTP Response Splitting, and others. Small and medium-sized businesses are the most vulnerable, with 43% of data breaches targeting this segment.

Hence, investing in a comprehensive security solution, such as Drupal Security Audit and Penetration Testing, is a wise choice because it helps to identify potential vulnerabilities and provides an opportunity to fix them before they can be exploited by cybercriminals.

In this blog, we shall concentrate on providing an overview of the specific Drupal module versions used to conduct Drupal security audit, as well as the relevant PHP and JavaScript libraries employed during the Drupal Site Audit (Fig. 1).

Drupal Security Audit: Summary of Modules and Libraries

Evaluating the Versions of Installed Drupal Modules

Drupal offers a view that displays all installed modules and provides information on their update status, including the presence of any security fixes in the latest version.

In the context of Drupal, information regarding potential security flaws in a module is made public once the author releases a patched version. While the author may attempt to conceal the exact code changes made to address the security issue, this only serves to prolong the time an attacker requires to find and exploit the vulnerability. Given the significance of time in such situations, it is imperative to keep track of security updates on a regular basis, not just during a Drupal security audit.

At Valuebound, we strongly advocate for the regular updating of all available modules. The presence of security fixes in a module update is critical in maintaining the robustness and security of the application.

Updating Drupal Modules with Patches

When updating Drupal modules, it is imperative to verify if a patch has been applied to a specific module. In such scenarios, we follow these steps:

  • Examination of the origin of the patch: Our first step involves checking if the patch was created by the Drupal community and if it addresses a specific issue reported on drupal.org. If so, Valuebound’s Drupal Site Audit tool investigates the corresponding issue that the patch addresses.
  • Latest Version of the Module: If the patch has been integrated into a newer version, we recommend updating the module and removing the patch. The code that addresses the security flaw or adds the required functionality is already present in the official, updated version of the module.
  • Updating and Testing: If the patch has not yet been incorporated into the latest version of the module, we recommend updating and testing the updated version of the patch.
  • Custom Project Code: In cases where the patch is not a product of the Drupal community but is instead the result of project-specific work, updating the module is still recommended. However, the responsibility of ensuring the correct operation of the patch rests with the individuals responsible for the custom project code.

After updating, it is essential to verify the functionality of the patch and introduce appropriate fixes, if required, to ensure its proper operation on the latest version of the module.

Examining PHP Libraries

In the next phase, the utilization of PHP libraries will undergo a comprehensive evaluation. This can be achieved by utilizing the "composer show" command or the "local-php-security-checker" package. The latter option is more advisable as it streamlines the process.

Drupal Composer Security Checker incorporates the security-checker package. However, the effectiveness of this module is limited, and the security-checker package itself has not been actively maintained since January 2021. As such, the "local-php-security-checker" package is the preferred option.

In the event that any security vulnerabilities are detected, it is recommended to promptly update the relevant library to maintain optimal security. Regular assessments of PHP libraries, similar to Drupal modules, should be integrated into a comprehensive security program.

Evaluation of JavaScript Libraries

The subsequent step in the process entails a comprehensive assessment of the utilized JavaScript libraries to verify their current status and the presence of security fixes. This can be achieved by conducting an inspection of both the library directory and the relevant package.json files.

For the library directory, a manual review of the version is required. On the other hand, the npm-audit command can be used to analyze the package.json files. The npm-audit command provides a comprehensive report of all identified vulnerabilities, including the threat level, the affected packages and dependencies, the package path, and a link to additional information about the vulnerability.

In the event that a vulnerability is detected, it is recommended to promptly perform an update. Regular scans of the JS libraries are encouraged and should be conducted more frequently than a full security audit.

Conclusion

Acquiring the information presented in this article represents a simple and effective method for enhancing the security of your application.

The first step in a comprehensive security audit, conducted by our team of Drupal experts at Valuebound through the Drupal Site Audit Tool, involves reviewing the versions of the solutions in use. Our team highly recommends regularly checking for updates, and promptly updating whenever a security patch becomes available.

For those seeking assistance with a comprehensive Drupal security audit to assess readiness for Drupal 10, reach out to us.

WhatsApp integration in Web Applications

In the age of digital communication, businesses are constantly searching for new and effective ways to reach their customers. With the popularity of WhatsApp, it’s no surprise that businesses are now exploring the option of integrating the app into their web applications.

WhatsApp integration provides businesses with a convenient and cost-effective way to communicate with customers, improve customer service, increase engagement, and reach a wider audience. In this blog, we will explore why WhatsApp integration in web applications is an important tool for businesses to consider, and how can they do it.

How to integrate WhatsApp into Web Applications?

Integrating WhatsApp into a web application can seem like a daunting task, but it is actually relatively straightforward. By using the WhatsApp Business API, developers can create a connection between the web application and WhatsApp, allowing for seamless communication between the two platforms.

The process typically involves obtaining a token from Wati.io, configuring the API settings, and integrating the API into the web application code. Once the integration is complete, businesses can start using WhatsApp to communicate with customers, send notifications, and respond to customer inquiries.

With the right tools and resources, integrating WhatsApp into a web application can be a smooth and efficient process, helping businesses to improve their communication with customers. In the sections below, we will guide you through a step-wise process of integrating WhatsApp into web applications.

How to integrate WhatsApp into Web Applications

Technical Implementation:

1. Sign up for Wati.io at https://app.wati.io/  
2. Obtain an Access Token to access the Wati API's server.  
    Example: you will receive a live server link, similar to https://<server>.wati.io/index.html.  
3. To send WhatsApp messages, create a template.  
Example: Navigate to https://app.wati.io/messageTemplate, click on "New Template Message".

You can either create a template from scratch or use an existing template. Add dynamic variable names to the template, which can be sent via the API service. See the template below for reference (Fig.1).

Creation of Template message in wati.io

4. For API documentation, review the Developer documentation, which is available in multiple programming languages including C, C++, Python, Go, and others (Fig. 2).

Developer Api's for wati.io

5. For detailed information on the API, refer to the reference documentation available at https://docs.wati.io/reference/introduction.

6. To access the available API services, navigate to the live server and authorize it using the Access Token generated in step 2 (Fig. 3).

API authorization

Find the Swagger documentation for the sendTemplateMessage request body below.

Body Parameters (Fig. 4):

template_name : Template created in wati.io to send message to end users

Broadcast_name : Broadcast name created while creating the template

Parameters : Input variables for templates

Api for sending whats-app message

7. We can now utilize the API in our application to send messages to end-users.

Example: The following Python code snippet demonstrates the use of the sendTemplateMessage API, incorporating body parameters such as the buyer_number, country_code, content:

The above function can serve as a useful tool for sending messages within the application.

Conclusion

With Wati.io's WhatsApp Business API, developers can easily set up a connection between their web application and WhatsApp. The API offers a sendTemplateMessage function to help you send messages effortlessly within your application. Upgrade your communication game today with a seamless WhatsApp integration! If you have any questions regarding this, drop us a message and we will answer shortly. 

Perform Drupal audit and Run Your Drupal 10 Upgrade in a 3-pronged Process

It is imperative for organizations to stay ahead in terms of open-source security and innovation. With Drupal 7 reaching its end-of-life in November 2022 and Drupal 8 in November 2021, followed by a subsequent website upgrade to Drupal 9, now is the time to upgrade or migrate to Drupal 10.

Valuebound has a proven Drupal site audit tool helping upgrade sites of all sizes, which we will outline in this guide. The usual upgrade process begins with a codebase audit, followed by addressing code and compatibility issues. In the final stages, a trial upgrade is performed to identify and resolve any remaining issues, leading up to the full Drupal 10 upgrade.

Conducting a site audit prior to migration or upgrade is recommended. A Drupal site audit provides an overview of your current system, including modules, themes, and custom entities, and recommends necessary actions. The Drupal Site Audit tool facilitates this process by performing a site assets audit and creating a map of these assets.

Planning Website Migration to Drupal 10

As you plan for your migration or upgrade, whether from Drupal 7 or 8, or 9, it is advisable, to begin with, a readiness audit. This audit will assess the level of effort required and provide recommendations to ensure a smooth transition to Drupal 10.

The process of upgrading to Drupal 10 can be summarized as follows:

  • Audit the codebase for deprecated code
  • Audit the codebase for composer compatibility
  • Address deprecated code issues
  • Address composer compatibility issues
  • Trial Drupal 10 upgrade and identify remaining issues
  • Complete the Drupal 10 upgrade

In this blog post, you will have a better understanding of the process and effort required for a successful upgrade, enabling you to plan your budget and timeline effectively.

Step 1: Assess the Current State of Your Website

Upgrading from Drupal 8/9 to Drupal 10 requires careful planning to ensure a successful outcome. The first step in this process is to understand the current state of your website.

It is best to perform a Drupal site audit, and here are a few key things to consider when auditing your Drupal website for the upgrade.

  • Determine Your Current Core Version: It is recommended to perform upgrades from the latest minor version of the core. If you are on Drupal 8, you should upgrade to Drupal 8.9 or later before attempting to move to Drupal 10. However, upgrading to Drupal 9 first, before moving to Drupal 10, is not necessary.
  • Management with Composer: Composer is a dependency manager for PHP that makes it easier to keep the core of your site, modules, and dependencies secure and up-to-date. If your Drupal 8 site was set up with an earlier version such as 8.1 or 8.2, it is likely not managed with Composer.
  • Hosting/Server Environment: Drupal 10 has specific minimum server requirements that must be met for your site to run on the server. Make sure to check the minimum requirements and verify them with your hosting company or server administrator.

Keep in mind that upgrading your server environment, including PHP and the database server, should be considered, but not performed until after you have upgraded your Drupal version locally or in a non-production environment.

Step 2: Assess the state of your third-party modules and themes

Upgrading to Drupal 10 requires considering the compatibility of your third-party modules and themes. While the Drupal 10 core has been stabilized, it may take some time for the larger community to release updated versions of their modules and themes.

Some developers have already started work on Drupal 10 upgrades, and some modules and themes are already available for Drupal 10. Others are still in progress. It's important to keep in mind that you have until November 2023 to upgrade your site to the latest version of the core and maintain security coverage. However, waiting until the last minute is not recommended.

To ensure a smooth upgrade, you should create an inventory of your third-party modules and themes and evaluate their update status. Check if they have an upgrade path and review the details of their plans in the relevant issue queues. If you discover any modules or themes without an upgrade path, consider finding an alternative or reaching out to someone who can help you update or create a custom solution.

Stay informed about the updates of the modules or themes that have an upgrade path but have not yet released a stable version. By doing so, you'll be prepared when the updates become available and can plan your site upgrade accordingly.

Step 3: Verify Compatibility with Custom Code

The release of major Drupal core updates often involves changes and deprecations to APIs, so it's wise to check the compatibility of your custom code before the official release of Drupal 10. To make this process easier, use tools like the Upgrade Status module or Drupal Rector, which can identify deprecations, make automated fixes and offer recommendations for further improvements.

You can start preparing your custom code for Drupal 10 while still using Drupal 8 or 9, which is a great way to get a head start on the upgrade process. When the time comes, you will be ready to smoothly roll out the complete upgrade once your contributed code and server environment are both prepared.

Conclusion

Drupal 10 was released to the public on December 14th, 2022, and it brings numerous new and exciting features to the table. While the upgrade process has become easier for Drupal 8 and 9 websites, it's still crucial to plan, prepare, and audit accordingly. Don't wait to start planning your migration to Drupal 10.

We hope these three simple steps will ensure a seamless and efficient upgrade experience. If you have any questions or need assistance with your upgrade journey, please reach out to us and we'd be glad to help.

Unleashing the Power of AI: A Deep Dive into ChatGPT

MIT researchers developed ELIZA in 1966, a key milestone in chatbot history due to its keyword-enabled responses that provided a human-like conversation experience. Later, A.L.I.C.E (1995) and SmarterChild (2001) paved the way for modern chatbots. In November 2022, OpenAI introduced ChatGPT, a cutting-edge AI chatbot, backed by Microsoft's $1 billion investment. ChatGPT is part of OpenAI and the Azure AI Platform.

What Is ChatGPT?

ChatGPT was launched as a prototype on 30, November 2022. ChatGPT is a huge language model developed by the OpenAI GPT-3 family of large language models. It's grounded on the GPT( Generative Pre-trained Transformer) armature and is trained on a massive dataset of textbook data. ChatGPT can be used for colorful natural language processing tasks similar to textbook generation, textbook completion, language restatement, and conversational AI.

It can understand and respond to a wide range of inputs and give applicable and coherent responses. It's trained to respond to colorful prompts and can also continue a given environment, which makes it suitable for erecting chatbots and other conversational AI operations.

How Did ChatGPT Become Skilled/Trained?

ChatGPT was trained by OpenAI's GPT-3 family of large language models, with 175 billion parameters and 570 gigabytes of text data, surpassing its predecessor GPT-2. This larger scale allows GPT-3 to perform tasks it wasn't explicitly trained on, like language translation, and sometimes outperform models trained specifically for those tasks.

ChatGPT was also trained on internet code and data sources like Reddit, and human feedback to understand human conversation style and respond in a human-like manner. A research paper on "Training Language Models to Follow Instructions with Human Feedback" showed positive results for InstructGPT, but also room for improvement.

Limitations of ChatGPT

Some of the limitations of ChatGPT include:

  • ChatGPT won't respond with harmful or toxic responses
  • Quality of answers depends on quality of inputs. Poor prompts may lead to wrong answers
  • ChatGPT is designed to provide answers that seem right, but they may not be correct
  • Some users report wrong answers, including nonsensical ones, from ChatGPT
  • OpenAI acknowledges on their website that ChatGPT can provide incorrect answers
  • ChatGPT is currently free during the "research preview" phase and open for users to test and provide feedback
  • OpenAI is seeking feedback to improve the AI's responses and correct any errors

Can ChatGPT Replace Google Search?

ChatGPT and Google Search serve different purposes and can't replace each other. ChatGPT is a language generation model that generates human-like text based on a prompt for tasks such as translation, summarization, and question answering. Google Search is a search engine that provides relevant information for a user's query. ChatGPT is useful for language-based tasks but can't replace Google Search as an essential tool for finding information. Google has its own AI chatbot, LaMDA, that performs close-to-human communication.

How Can ChatGPT Be Used?

ChatGPT is a powerful language generation model that can be used for a wide range of language-based tasks. Some of  the approaches it may be used encompass:

  • Content creation: ChatGPT can assist users in generating text for different purposes like content creation, writing, and even for coding.
  • Language Translation: ChatGPT can be used for language translation by providing the text in one language and asking it to translate it to another.
  • Summarization: ChatGPT can summarize long documents or articles by extracting the key points and presenting them in a condensed format.
  • Question answering: ChatGPT can answer questions by providing it with a prompt that includes a question and relevant information.
  • Dialogue Generation: ChatGPT can be used to generate dialogue for chatbots, virtual assistants, and other conversational systems.
  • Text completion: ChatGPT can be used to complete a text given a starting prompt, it can be used in writing and coding.
  • Text classification: ChatGPT can be fine-tuned to classify text into different categories based on its content.
  • Language model fine-tuning: ChatGPT can be fine-tuned to perform specific tasks like sentiment analysis, named entity recognition, and more.
  • Text generation: ChatGPT can be used to generate text based on a given prompt, it can be used for creative writing, poetry, song lyrics and more.
  • Text-to-speech: ChatGPT can be used to generate speech from text, it can be used for assistive technology and more.

These are just a few examples of the many ways ChatGPT can be used. The model's capabilities and potential are constantly evolving as it continues to be developed and improved.

Conclusion

ChatGPT is an AI language model by OpenAI that uses machine learning to generate human-like text. It's trained on large text data to handle a variety of natural language inputs for tasks like answering questions, writing essays, and communication. Its transformer-based architecture enables it to handle long-term dependencies in input and generate coherent text. If you have any questions regarding this insight, drop us a message or connect with us.

Release Plan of Drupal 10 Version: Get Ready to Upgrade

From the mid of 2019 to December 2022, 2129 individuals from 616 different organizations, including Valuebound, worked together as part of the Drupal community to successfully address 4083 issues. As a result, the highly-anticipated Drupal 10 became available for use on 15th December 2022. 

Drupal 10 is designed to ensure long-term stability and security for users, with all future updates and features implemented. Firstly, it provides the latest features and improvements that can help improve your website's performance and security. Additionally, it ensures that you receive the latest security coverage, which is essential in keeping your website safe from potential vulnerabilities.

By upgrading to Drupal 10, you are ensuring that your website is compatible with future releases, making it easier to update. This blog gives you a release plan for the Drupal version and how you can prepare your business to upgrade to the latest version of Drupal.

What is Drupal Version 10.0.2?

The latest Drupal 10, 10.0.2 has been recently released on 18 January 2023. This release is specifically designed to fix bugs and is now ready to be utilized on live production sites. In terms of security, Drupal 10.0.x will be covered until December 2023.

Drupal 10 Release: How to Plan

Depending upon which stage you are in the Drupal journey, we suggest the below plan to upgrade to Drupal 10 (Fig. 1):

Drupal 10 Release Plan

 

Update to at least Drupal 9.4.4: When upgrading to a new major version, you can typically do so from the last minor version of the previous major version. However, there is an exception to this rule with Drupal 10. Upgrades to Drupal 10 are only supported from Drupal 9.4 or later versions.

Upgrade to Drupal 9.5: Drupal 10 has been released in conjunction with Drupal 9.5. While Drupal 9.5 includes many of the same changes as Drupal 10, it still maintains backward compatibility layers that have been added through Drupal 9.5's release. Therefore, for the smoothest upgrade path users should first update to Drupal 9.5 before updating to Drupal 10.

Starting a new Drupal Project: For those starting new Drupal projects, there's now a choice between Drupal 9.5 and 10. It's recommended to choose Drupal 10 for forward compatibility with future releases.

Both 10.0 and 9.5 include all the latest changes, and they have the same APIs and features aside from a few edge cases. This also means that modules and themes can be compatible with Drupal 9 and 10 at the same time. 

However, to ensure easy updates in the future, it's best to plan to adopt Drupal 10 since it will have future releases.  
To make the process of upgrading as seamless as possible, there are several automated tools available that can help you prepare for the transition. These tools can help you check the compatibility of modules, themes, and sites with the new version, and make any necessary adjustments before upgrading.

Release Plan: Which release do I choose?

Following is the best release plan that is recommended, according to Drupal.org (Fig. 2):

Drupal Release Plan 
 

  • The latest version of Drupal 10, 10.0.x will have security support until December 2023.
  • If you are currently using Drupal 9.5.x, it is recommended to update to Drupal 9.5.2 as soon as possible and later plan to upgrade to Drupal 10 by November 2023.
  • For those using Drupal 9.4.x or earlier versions, it is recommended to update to Drupal 9.4.10 and to upgrade to a version higher than 9.5 in the near future.

We need to remember that versions of Drupal 9 prior to 9.4.x have reached their end-of-life and will not receive any security coverage. Staying with Drupal 8 or earlier is not recommended now as they have reached end-of-life.

Get Ready to Upgrade

There are two ways to update the Drupal core:

MethodAudience
Manual
  • Unfamiliar with a command-line interface 
  • Disinclined to learn Drush or Composer, and 
  • Unable to access the shell
Composer 
(Recommended)
  • Comfortable using command-line interface 
  • Possesses access to the command line shell, and 
  • Eager to utilize the capabilities of Composer command line tools

 

In conclusion, upgrading to the latest version of Drupal 10 helps you stay updated with recent features and security updates. If you are looking to discuss your Drupal upgrade plan, book an audit with our Drupal Site Audit tool, or give us a call.

Celebrating Anoop Singh's Success Story: The ‘Magician’ of Drupal Development at Valuebound

I recently had the opportunity to speak with Anoop Singh, a Software Development Engineer and the "Magician of Drupal Development" at Valuebound. Anoop joined Valuebound in 2020 and has achieved notable success in delivering error-free projects and earning client satisfaction. Anoop has been felicitated with several awards recognizing his outstanding team performance. Here's an excerpt from my conversation with Anoop. 

Can you share your experiences as a software engineer? What were some of the most significant challenges you faced in professional growth and development?

Anoop: I have had a fulfilling experience as a software engineer. I received a lot of praise from my team and clients, which made me and my family proud of my accomplishments. I am content with my role and would like to express gratitude to Valuebound for the opportunity.

In what ways do you feel Valuebound has supported your growth as a software engineer? What are the key takeaways from your time here? Can you also discuss some notable contributions or projects that have contributed to your technical and professional development?

Anoop: I began my tenure at Valuebound in February 2020. The company has been instrumental in my growth as a professional. I have acquired plethora of skills, including managing multiple projects, leading teams, implementing team members' growth plans, and utilizing advanced version control systems. The daily standup (DSM) of the project and monthly business updates were new concepts for me, but I was able to quickly adapt with the help of my excellent and supportive team members.

Anoop Singh Valuebound

I wanted to ask you about your personal goals, driving force, and aspirations. If you could pursue any profession other than being an engineer, what would it be?

Anoop: Earlier, I was uncertain about what I would choose, but I firmly believed in the power of hard work. When I was in 10th grade, I attended computer classes. After that experience, I decided to delve deeper into the field. This led me to complete my degree in Computer Science and pursue a career in the technology industry.

How do you stay updated on new technologies and industry advancements? How do your team and manager assist in your professional development? 

Anoop: Indeed, I am constantly striving to improve and stay current. Recently, I obtained a certification in Introduction to Drupal site-building from Forcontu, which is a Spanish training center. I was the only student from India in the class, and I ranked fifth during the course. This achievement was possible due to my willingness to seek guidance and collaborate with others.

Can you share some examples of projects where you were able to showcase your renowned problem-solving abilities within the Valuebound team? 

Anoop: I have actively worked on multiple projects at Valuebound and also provided support on other projects. I am capable of handling multiple projects at the same time and enjoy taking on challenges. 

One of the most challenging projects I have worked on was for one of our clients, but it was also a great learning experience. I was brought on to the project in July 2021 and was able to complete my work in October 2021, two months ahead of schedule, receiving positive feedback from my team.

You have been recognized as “Magician of Drupal”. At Valuebound, you received many awards and recognitions for your contributions. Can you share more about that?

Anoop: Frankly speaking, I am sometimes surprised by my own abilities, especially when I'm able to accomplish tasks quickly. I am truly appreciative of Valuebound for recognizing my contribution through multiple accolades, including being honored as part of the "Best Team" for my outstanding team performance. I have also been felicitated with other titles such as ‘The Spontaneous Recognition Award’, and received gift vouchers for Drupal contribution. 

Anoop Singh's Award

My work has always been error-free and clients were always satisfied. They even gave me a recommendation on LinkedIn and called me a "magician."

Anoop Singh LinkedIn Recommendation

As a seasoned software developer, what guidance would you offer to those just starting out in the field?

Anoop: As a software engineer, much of your time is likely spent in front of a computer. However, it's crucial to consider what you're doing during that time. Are you utilizing it to enhance your career and growth? Are you using it to develop new skills or contribute to the community?

By actively engaging in these activities, you can effectively communicate your progress and achievements on digital platforms. This will allow you to share your journey and showcase your growth within the tech industry, which is constantly evolving. Therefore, it's necessary to stay up-to-date with these changes and continue to learn and practice new skills.

Drupal 10: Top 10 Features and Improvements

Drupal, the open-source content management system is known for its versatility and ability to serve the needs of organizations of all sizes. Drupal.org recently launched the new version Drupal 10 on December 15, 2022. Drupal 10 offers more powerful tools for creating structured and dynamic web content with a modernized backend look and a future-proof platform upgrade. The new features include the Claro administration theme, the Olivero front-end theme, CKEditor 5, and more.

Dries Buytaert, Founder of Drupal mentions, "Drupal 10 includes many new features that appeal to developers and content creators alike. A stronger developer and site builder experience combined with easier content authoring and editing make this a key update for all users."

In this blog, we highlight the top features and improvements of Drupal 10 (Fig. 1). So let’s get started.

Drupal 10 Features

New initiative for Drupal beginners

Drupal has been found to have a lower approval rating among new users compared to expert users. This led to an initiative being launched by Drupal's founder, Dries Buytaert, to address the needs of beginner users. This initiative bundles together three modules - Media, Layout Builder, and Claro - that together create a more user-friendly experience for new users. These modules have been present in Drupal 9, but they are now considered stable enough to be enabled by default in Drupal 10.

CKEditor 5 for new text editing experience

Drupal 10 introduces a new text editing experience with the upgrade to CKEditor 5. This version boasts a modern and refined look, with a simplified interface that prioritizes user experience.

CKEditor 5 does away with right-click menus, making it more touch-friendly than its predecessor. However, it should be noted that the number of options for editing links and images may be more limited in comparison to version 4. This specialization is geared towards content editors, rather than site builders, and is seen as a positive step forward in this area.

 

New look for Drupal with the Olivero theme

The Olivero theme serves as the face of Drupal, providing a modern and polished appearance to new users. As a core component of Drupal, it sets a high standard for other contributing themes.

One of its standout features is its accessibility, which includes a well-designed dropdown menu system that prevents menu items from extending beyond the edge of the browser.

Project Browser allows finding modules from within the website

The Project Browser initiative offers an easy way for Drupal users to discover and install contributed modules and themes directly from their website. This feature is similar to what has been available in WordPress for some time, but Drupal aims to improve upon it by automatically checking for dependencies and incompatibilities.

This is a valuable addition for small-business users and can help mitigate the issues of conflicting and crashing plugins that are often encountered in WordPress development.

New admin theme Claro

Drupal 10 also introduces a new admin theme, Claro, which offers an improved user experience and a more modern appearance. While the Olivero theme is primarily used as a placeholder in most projects, the Claro theme is where users will spend most of their time.

The previous admin theme, "Seven," had become outdated by 2022 and the new Claro theme is a significant upgrade. Additionally, the team behind Claro also maintains a sub-theme called "Gin," which includes even more modern features that are not yet ready for Drupal core.

Automatic Updates

Automatic updates have been a contentious issue within the Drupal community, with some users opposed to the idea. Users do not want to spend a significant amount of time and money on updates for Drupal core and additional modules.

Development of the automatic updates feature is ongoing in a separate contrib module that is available for testing. However, it is currently limited in its capabilities as it only updates the Drupal core without causing any disruptions to the site. Updating other modules and themes is still considered experimental.

Despite the challenges, automatic updates could be a significant security advantage for small-business Drupal websites, as many sites do not install updates regularly.

New workflow for theming Drupal 10

Drupal 10 brings significant improvements for front-end developers, particularly those new to the platform. Customizing the CMS to match a design and branding is often the first step for developers, and in the past, this process has been known to be a painful experience.

However, with Drupal 10, the process has been made much easier. Instead of sub-theming the Classy theme, developers can now copy the starter kit theme and customize it. This eliminates the need to rely on an outdated base theme that is frozen in Drupal core.

Additionally, this change is also beneficial for themers as it allows them to keep all the files in one convenient place within their custom theme folder, rather than having to search for the files in the Classy theme and copying them over.

PHP 8.2 and Symfony 6 guarantee better backend performance

Symfony 6 primarily serves as a cleaning effort. It removes a lot of old, deprecated code, and therefore, developers will need to update any modules and themes that utilize outdated Symfony APIs. Once these updates are made, the website will be able to benefit from the latest PHP and Symfony improvements and offer a more responsive experience to users.

Better front-end performance with jQuery phased out

Drupal 10 phased out the use of jQuery, leading to more efficient use of native functions. The core team is taking a phased approach to the removal of jQuery from Drupal 10. They are focusing on removing plugins that are easy to remove before tackling more complex areas. Progress includes the remremoving the "jQuery once" plugin and significantly reducing UI plugin usage in the core.

Challenges that lie ahead include replacing jQuery's event handling and AJAX features with plain Javascript. Anonymous visitors will not load jQuery in Drupal 10, but it may take a few more years for its complete removal for editors and site builders.

Easy upgrade from Drupal 9 to Drupal 10 with Drupal Rector

Drupal community decided to make updates more manageable after the transition from Drupal 7 to 8. The architecture of Drupal 8+ has advanced enough to make this a reality. Additionally, the tool Drupal Rector has also played a role in simplifying updates. Though it was already available when Drupal 9 was released, it has since matured and is now even more effective.

Drupal Rector can now automatically generate most of the necessary changes for migrating custom modules to Drupal 10, saving developer time and making the upgrade process smoother than ever before.

Upgrade to Drupal 10 with all new features

Drupal has released both versions 10.0.0 and 9.5.0 simultaneously. While Drupal 9.5.0 includes many of the same changes as Drupal 10, it also includes backwards compatibility layers. It is recommended to first upgrade to Drupal 9.5.0 before upgrading to Drupal 10 for a smoother transition.

For new Drupal projects, you have the choice between Drupal 9.5.0 and 10.0.0. It is generally advisable to choose Drupal 10 for forward compatibility with future releases.

Regardless of the initial version chosen, all new features will be added to Drupal 10 minor releases. It is important to plan for adopting Drupal 10 in order to easily update to future releases such as Drupal 10.1. Would you wish to speak to our experts regarding the Drupal 10 upgrade, drop us a hello.

Download the Drupal Guide
Enter your email address to receive the guide.
get in touch