Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#5509 closed Question/How do I...? (fixed)

Any (smart) way to patch Drupal 7 core while still using the shared Drupal installation?

Reported by: Jack Aponte Owned by: Ross
Priority: Medium Component: Tech
Keywords: drupal7 core_patch Cc:
Sensitive: no

Description

In order to use a module required for a client's project, I need to patch Drupal 7 core (ugh, I know.) The required patch is to $DRUPAL_ROOT/includes/module.inc, not to a core module.

The site is using MFPL's shared Drupal 7 code base, so I'm not sure of the best way to proceed. Should I...

  • Unlink _only_ the $DRUPAL_ROOT/includes/ directory, patch the file directly, then link $DRUPAL_ROOT/includes/ again once the patch is committed to core? Probably a bad idea since the rest of the MFPL Drupal 7 code might get updated in the meantime, throwing things out of whack and requiring constant updates on my part.
  • Unlink the entire $DRUPAL_ROOT from the MFPL shared code base until the patch is committed to core? Probably the better option, but is it easy to unlink from the shared code base and then relink again later?
  • Just wait to use this module until the patch is finally committed to core? Not ideal for the client, but if the options above are too wrongheaded or work intensive to pursue then waiting is better.
  • Something else entirely?

Thanks in advance!

Change History (4)

comment:1 Changed 7 years ago by Ross

Keywords: drupal7 core_patch added
Owner: set to Ross
Status: newassigned

Hi Jack,

I think I would take the following approach:

  1. Move the current includes symlink to oldincludes
  2. make a new includes directory
  3. symlink the contents of /usr/local/share/drupal-7/includes/ into the newly created includes directory.
  4. make sure everything works.
  5. remove the includes/module.inc and copy /usr/local/share/drupal-7/includes/module.inc to includes.
  6. patch module.inc as you need.

This approach means that everything stays up to date except the module.inc file itself. if you need to do a full reversion, then you can just mv includes out of the way an move oldincludes back to includes. The (fully tested) commands would be as follows from the web root:

$ mv includes oldincludes
$ mkdir includes
$ ln -s /usr/local/share/drupal-7/includes/* includes/
$ rm includes/module.inc
$ cp oldincludes/module.inc includes/
$ emacs includes/module.inc

This would be my approach and likely the one with the least potential problems.

~/ross

comment:2 Changed 7 years ago by Ross

Resolution: fixed
Status: assignedfeedback

comment:3 Changed 7 years ago by Jack Aponte

Status: feedbackclosed

Thanks so much for helping me think this through, Ross! Looks like a good solution to me. I'll post again if I encounter any problems, but I doubt I will.

comment:4 Changed 7 years ago by Jack Aponte

Hey ross – just wanted to let you know that I finally got around to this work, and your commands worked like a charm. Thanks so much, again!

Please login to add comments to this ticket.

Note: See TracTickets for help on using tickets.