Jump to the navigation menu

Don't hack core

I've worked on a lot of Drupal projects and there have been times when previous Developers have "hacked" Drupal core or contrib modules by editing them to add or change functionality.

This is a short-sighted approach, as any changes to third-party code such as Drupal core or contrib modules would be lost when a new version is downloaded.

Most of the time, changes can be made within custom code that won't be overwritten and accidentally lost.

But in cases where the source code needs to be changed, you can patch files instead.

You can commit the patch file to your project to save the changes, but you're responsible for maintaining it and ensuring it applies to any future updates of the code.

If you can, commit the changes upstream.

Then you won't need to patch files and others will benefit from the contribution.

- Oliver

Was this interesting?

Sign up here and get more like this delivered straight to your inbox every day.

About me

Picture of Oliver

I'm an certified Drupal Triple Expert with 18 years of experience, a Drupal core contributor, public speaker, live streamer, and host of the Beyond Blocks podcast.