Login / Status
developer.Resource
Home . Development . Bug Fixing . Bug fixing . Patches
Sponsors
hosted by punkt.deTYPO3 and Open Source Magazine

Creating a patch file

Patches are sets of changes to the TYPO3 source code that aim to resolve a bug or introduce a new feature.

From a technical point of view the differences introduced by a patch are best represented in "diff" format. This file format contains just the differences between two files. Diffs are widely used for development because they allow easy reviewing of changes to the program code. TYPO3 development uses the so-called "unified diff" (a diff variant that contains three lines of context before and after that part that was changed).

If you already work on the source code taken from the Git repository, please follow the contribution workflow instructions.

If you're working just on some copy of the TYPO3 source code, you may generate a diff using the "diff" command-line utility. Example:

diff -ru typo3_src.orig/ typo3_src.new/ > bug_1234.diff
 

How to apply a patch

Patch your source code using a diff file:

cd typo3_src.new/
patch --dry-run -p1 < ../bug_1234.diff

(Use the --dry-run parameter to first check if the patch applies successfully. Run the same command again without this parameter to make the changes effective).

Have a look at Wikipedia for more information about "diff" and "patch".

Again if you use Git, please refer to the contribution workflow instructions.