LogoLogo
10.0.x
10.0.x
  • Overview
    • About Varbase
    • Roadmap
    • Release Cycle and Supported Versions
    • How to Get Support
  • Developers
    • Getting Started
    • Installing Varbase
      • Requirements
      • Installing Varbase locally with DDEV
      • Installing Varbase locally with Lando
    • Understanding Varbase
      • Basic Concepts
      • Core Components
        • Varbase Core
          • Varbase Admin
          • Varbase Page
          • Varbase Security
          • Varbase Webform
          • Varbase Default Content
          • Varbase Tour
        • Varbase Media
        • Varbase Editor
        • Varbase Email
        • Varbase SEO
        • Varbase Workflow
        • Varbase Dashboards
        • Varbase Layout Builder
          • Varbase Landing page (Layout Builder)
          • Varbase Heading Block
          • Varbase Rich Text Block
          • Varbase HTML Code Block
          • Varbase Media (Image/Video) Block
          • Varbase Gallery Block
        • Varbase Components
        • Vartheme Claro
        • Vartheme BS5
      • Optional Components
        • Varbase AI
          • Varbase AI Default recipe
          • Varbase AI Editor Assistant recipe
          • Varbase AI Image Alt recipe
          • Varbase AI Taxonomy Tagging recipe
          • Varbase AI Agents recipe
        • Varbase API
        • Varbase Internationalization
        • Varbase Hero Slider
        • Varbase Carousels
        • Varbase Blog
        • Varbase Search
        • Varbase Social Single Sign-On
        • Varbase Media Twitter
        • Varbase Media Instagram
        • Varbase Content Planner
        • Varbase Bootstrap Paragraphs
          • Varbase Bootstrap Paragraphs Text and Image
        • Varbase Landing Page (Paragraphs)
      • Additional Components
        • Varbase Media Header
        • Varbase FAQs
        • Varbase Reports
        • Varbase Commerce
        • Varbase YouTube Import
      • Development Components
        • Varbase Development
        • Reroute Email
        • Varbase Updates Helper
      • Deprecated Components
        • Varbase Media Hero Slider
        • Varbase Style Guide
        • Vartheme BS4
        • Varbase Total Control Dashboard
    • Configuring a Varbase Site
      • Navigation
        • Defining Active Menu Trail Using Menu Position
      • Using View Modes Inventory
      • Content Moderation and Workflows
      • URL Aliases in Varbase/Drupal
        • Configuring URL Aliases
        • Managing URL Aliases
      • Managing URL Patterns for Multilingual Websites
      • Managing Date and Time Formats to Display Across the Site
      • Using Varbase Layout Builder
        • Creating a Landing Page With Varbase Layout Builder
        • Activating Varbase Layout Builder for Content Types
      • Configuring Pathologic When Going Live
      • Configuring SEO Features
        • Disallow Oembed Media Links
      • Configuring Security Features
        • Spam Protection
        • Password Policies
        • Other Security Kits
        • Flood Contorl
        • Enable HTTP Password Authentication
      • Configuring JSON:API Features
      • Configure Varbase Media Hero Slider
      • Configuring Varbase Media Header
      • Configuring Varbase Mailer Settings
        • Configure Symfony Mailer
      • Configure Level of Logging and Errors
      • Entity Definition Update Manager Class
      • Module Installer Factory Class
      • Configure Ckeditor 5 Media Embed
    • Theme Development with Varbase
      • Understanding The Vartheme Starterkit Theme
      • Creating Your Own Theme
      • Integration of Varbase with Storybook 1.0 - CL Server
      • Integration of Varbase with Storybook 2.0
      • Customize a Varbase Single Directory Components (SDC) In a Custom Theme
      • Local Tasks and Moderation Sidebar
      • Add Preloaded Fonts in Vartheme
      • Command to Install Needed Theming Tools
      • Manually Install Needed Theming Tools
    • Launching a Varbase Site to Production
    • Updating a Varbase Site
      • Understanding Varbase Updater Package
      • Handling Patches When Updating
      • Handling Configuration Updates
      • Updating Varbase to work with Composer 2.0
      • Updating Drush to the Latest Stable Version
      • Version Update Guides
        • Updating Varbase ~9.0 to Drupal 10
        • Updating from Varbase 8.x to 9.x
    • Varbase Patches
    • Frequently Asked Questions (FAQs)
    • Extending Varbase
      • Overriding Varbase
      • Creating Your Own Feature
      • Install Needed YARN and Webpack Tools
      • Compiling Provided Component Styles
      • Check Standards/Practice Coding And Linting
  • Content Designers
    • Accessing the Administration Area
      • Website Environments
    • Dashboard
      • Reports
    • Content Management
      • Create Content
        • Rich-Text Editor “WYSIWYG”
      • Modify Content
      • Delete Content
      • Preview Content
      • Bulk Edit Content
      • Publish Content
      • Authoring Information
    • Content Structure
      • EntityQueues
        • Add a New Term
      • Menu Management
        • Add Menu Items
        • Update Menu Items
        • Adding a Page to the Menu
      • Taxonomies
        • List Terms
        • Add Terms
        • Reorder and Edit Terms
    • Content Translation
      • Translating Content
      • Language Switcher
      • Deleting a Translation
      • Editing a Translation
    • Content Workflow
    • Layout Builder
      • Section
        • Section Styles
      • Block Management
        • Block Styles
      • Reordering Blocks
    • Webforms
      • Create New Webform View
      • Setting up Emails Handler Conditions
      • Setting up Confirmations Message Settings Types
    • Media Management
      • Accessing the Media Library
      • Uploading Media Files
        • Image
        • Remote Video
        • Video
      • Applying Metadata and Descriptions
      • Resizing Images
    • User Management
      • Login & Registration
      • Add User
      • Edit User
      • Delete User
      • Simulating Another User
      • Default Roles and Site Personas
        • Edit Roles' Permissions
        • Managing Roles
    • URL Management
      • URL Aliases
      • Generating URL Alias
      • URL Redirects
      • Domain Redirects
    • SEO Management
      • XML Sitemap
      • Meta Tags in Varbase
      • Disallow Indexing for Content Items
    • Site Configuration
      • System
        • Clearing Varbase Cache
        • Google Analytics
        • Mail Templates
      • User Interface
        • Coffee
        • External Links
        • Gin Moderation Sidebar
        • Layout Builder Modal
        • Moderation Sidebar
        • Shortcuts
        • Taxonomy Manager
        • Tours
        • CL Components
        • Antibot
        • Responsive Preview
        • Navigation Settings
      • Development
      • Varbase Settings
      • Web Services
        • OpenAPI
    • Additional Tips
      • Content Uploading Standards
      • Common Error Handling Tips
      • Glossary
  • Contributing
    • Contributing to Documentation
Powered by GitBook
On this page
  • Managing Only Local Patches for Projects
  • Remove Varbase Patches in Varbase ~10.0.0
  • Remove Varbase Patches in Varbase ~9.1.0 for CKEditor 5 Compatibility
  • Remove Varbase Patches in Varbase ~9.1.0 for CKEditor 4 Compatibility
  • Storage of Local Patches Branch
  • Examples of Names for Local Patch files:
  • Why Direct Links for Merge Requests Aren't Preferred
  • Handling Varbase Patches Ignoring
  • Drush Command to Clean up Any Merge Request Patches
  • Clean up the Root `composer.json` File
  • Clean up the External `patches-file` JSON File
  1. Developers

Varbase Patches

PreviousUpdating from Varbase 8.x to 9.xNextFrequently Asked Questions (FAQs)

Last updated 7 months ago

When working with Drupal, it's common to patch core or contrib modules to fix bugs or review code changes before they're officially released. While applying patches via patch files is straightforward, using GitLab's merge request (MR) feature presents a challenge due to unstable diff URLs.

As multiple commits are added to an MR, generating a stable patch file becomes complex. To create a static patch file for an MR at a specific point in time, simply set up a 'patches' folder next to your root composer.json. Download the .diff or .patch into this folder and utilize to apply it seamlessly.

has the list of needed patches for Varbase used packages with Composer Patches.


Use "vardot/varbase-patches": "~10.0.0"

with Varbase ~10.0.0 CKEditor 5 and Drupal 10


Use "vardot/varbase-patches": "~9.2.0"

with Varbase ~9.1.0 CKEditor 5 and Drupal 10


Use "vardot/varbase-patches": "~9.1.0"

with Varbase ~9.1.0 CKEditor 4 and Drupal 10


Managing Only Local Patches for Projects

When there's a need to handle local patches for a project without relying on Varbase Patches.

Remove Varbase Patches in Varbase ~10.0.0

With CKEditor 5 and Drupal 10 : Use the "Vardot/varbase-patches": "10.0.0.0" static version to have no patches and manage local patches in the project with a copy of patches from


Remove Varbase Patches in Varbase ~9.1.0 for CKEditor 5 Compatibility


Remove Varbase Patches in Varbase ~9.1.0 for CKEditor 4 Compatibility

Storage of Local Patches Branch

!

It should be considered a permanent part of the solution and should not be deleted under normal circumstances. Deleting patches can lead to unexpected behavior or loss of functionality, especially if other components of the system depend on them.

New patches should follow the following in the name of the patch file

[package name]--[Date]--[issue number]-[comment number]--[MR number/commit number].patch

Branch name for the package could be added too.

This will be a copy of Merge Request (MR), as it is important not to add .diff or .patch link to an MR as the code could change in anytime.

Examples of Names for Local Patch files:

  • drupal-core--2024-01-09--3049332-85.patch

  • drupal-core--10-2-x--3046152-49.patch

  • rabbit_hole--2024-02-04--3419073-3.patch

  • ui_patterns_settings--2023-12-17--3409221-3--mr-21--39e896da.patch

Why Direct Links for Merge Requests Aren't Preferred

When creating merge requests, it's better to use composer-patches' solution for dealing with merge request URLs from drupal.org. This solution adds support for patch checksums, preventing issues where the new patch wouldn't apply due to checksum mismatches.

Such issues can disrupt builds, compromising stability and security. Note that this solution is included in version 2, which hasn't been officially released at the time of writing.

Choosing direct merge requests over patching isn't the best option for maintaining stability, especially considering Drupal's shift from patching to merge requests.

As you implement these changes, it's recommended to convert existing patches into merge requests. Merge requests are preferred over patches in the Drupal community.

Therefore, necessary patches originating from merge requests will be stored in this designated storage branch.


Handling Varbase Patches Ignoring

Suppose you need to exclude a specific patch while utilizing Varbase Patches in your site. For instance, let's consider the scenario where you wish to either enhance an existing patch or disregard it altogether.

To achieve this, incorporate the following snippet into your root composer.json file:

"patches-ignore": {
  "vardot/varbase-patches": {
    "drupal/core": {
      "Issue #2869592: Disabled update module shouldn't produce a status report warning":
      "https://www.drupal.org/files/issues/2869592-remove-update-warning-7.patch",
    }
  }
}

By integrating this set, you effectively instruct Composer to overlook the specified patch within Varbase Patches. This empowers you to manage patches more efficiently, whether by improving them or opting out of certain patches altogether.

Drush Command to Clean up Any Merge Request Patches

Clean up the Root `composer.json` File

Name: varbase:composer:cleanup:patches Aliases: var-ccup Description: This command detects any merge request patches, downloads them to the local patches folder with a timestamp, and updates the root `composer.json` file to use the timestamped local patch file.

Example:

./bin/drush varbase:composer:cleanup:patches

or

./bin/drush var-ccup

Clean up the External `patches-file` JSON File

Name: varbase:composer:cleanup:patches-file Aliases: var-ccupf Description: This command detects any merge request patches, downloads them to the local patches folder with a timestamp, and updates the `patches-file JSON` file to use the timestamped local patch file.

Example:

./bin/drush varbase:composer:cleanup:patches-file

or

./bin/drush var-ccupf

With CKEditor 5 and Drupal 10 : Use the "Vardot/varbase-patches": "9.2.0.0" static version to have no patches and manage local patches in the project with a copy of patches from

With CKEditor 4 and Drupal 10 : Use the "Vardot/varbase-patches": "9.1.0.0" static version to have no patches and manage local patches in the project with a copy of patches from

This branch is a storage branch for the list of needed local patches.

To understand the process better, consult the , and for detailed instructions on handling issues.

.

composer-patches
Varbase Patches
https://github.com/Vardot/varbase-patches/blob/10.0.x/composer.json
https://github.com/Vardot/varbase-patches/blob/9.2.x/composer.json
https://github.com/Vardot/varbase-patches/blob/9.1.x/composer.json
Patches
Drupal Contributor Guide
Creating merge requests
Patches from drupal.org merge request URLs are dangerous?
Add support for patch checksums
composer-patches 2.0.0 hasn't been released yet