Adds API to patch Drupal core and contributions from code.

Using Patchdoq module

In you own module you should implement hook_patch(). For example:

/**
 * Implementation of hook_patch().
 */
function mymodule_patch() {
  $path = drupal_get_path('module', 'mymodule');
  return array(
    //
    // Drupal core patches.
    //
    'simpletest drupal.js' => array(
      'name' => t('Simpletest module fix'),
      'description' => t('My hacks to simpletest module.'),
      'file' => $path .'/drupal/drupal.js.patch',
      'patch arguments' => '-u -p1',
    ),
    //
    // 3rd party contributed modules patches.
    //
    'cck content' => array(
      'name' => t('CCK content module fix'),
      'description' => t('My hacks to CCK content module.'),
      'file' => realpath($path .'/modules/cck.patch'),
      'patch arguments' => '-u -p0 -d "'. drupal_get_path('module', 'content') .'"',
    ),
  );
}

More information

Patching Drupal core through web-admin.

Project Information

Downloads