Intro

First of all, what is "monkey patch"? As Wiki says "A monkey patch is a way to extend or modify the run-time code of dynamic languages without altering the original source code." (see Monkey patch article for reference).

What for?

Forwardport doctrine (see #1932290: Forwardport doctrine - a proposed solution for Drupal major version migration problem) stuck on huge problem: we can't override any function (or constant) definition, but it is necessary for our purposes. For example, some of the constants defined in D6 differ from defined in D7, though their name are the same. What we need is to override once defined constant - but we can't till present.

Proposal

Use patchwork library.
It opens the door for such innovations as:

Solution

Depend on patchwork as a library (using Libraries module).

Comments

PatchRanger’s picture

Status: Active » Fixed

Done:

  1. Created tests, working without Patchwork.
  2. Created 7.x-2.x branch for this refactoring.
  3. Switched to Patchwork, leaving all tests (including especial new one) passed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.