Overriding Varbase
First Rule in Overriding
Custom Tweak Modules
Create custom modules and have your override in them.
Basic hooks like hook alter.
Use Event Subscribers and dispatches.
Switching a Class for a service with a custom or extended Class.
Patching Bugs
In case of capturing a bug. Search if it was filed in an issue. Look if the a patch fix for the issue was uploaded.
Example: In the composer.json file for the project:
Please add the "Issue Number" and the URL for the used patch
Patch for a New Enhancements
An introductory patch for an enhancement over a Varbase component or any Drupal project is welcomed.
A patch may not be committed on the spot. It will need review, and testing for what affect it may do for websites.
Ignoring Patches
Using the cweagans/composer-patches composer plugin with patches-ignore
There may be situations in which you want to ignore a patch supplied by a dependency. For example:
You use a different more recent version of a dependency, and now a patch isn't applying.
You have a more up to date patch than the dependency, and want to use yours instead of theirs.
A dependency's patch adds a feature to a project that you don't need.
Your patches conflict with a dependency's patches.
Example:
The Varbase Core module is requiring Drupal Core with "drupal/core": "~9.0", . Having number of patches to fix issues or overriding Drupal core.
Let imagine that the Drupal core release team had a new release, But they had committed the following issue:
The patch fix for the core issue was added when a fix was needed for the following issue:
At the point of a new release for Drupal core and in case the patch was committed.
The cweagans/compsoer-patches composer plugin will not allow to apply it if it was committed.
Ignore the patch being used as in the following example method:
Recommended Patching Method with Gitlab Issue Forks
If you use the URL to the Gitlab MR directly, your code base will change without warning, as people work on the merge request.
Download the
.diffor.patchfile in apatchesfolder in the project.Add the module name, issue number, and date for the MR changes to the name of the file.
Add the patch local patch to patches.
Example ( NOT Recommended ):
Example ( Recommended remote patch file ):
Example ( Recommended local patch/diff file ):
Last updated