make customizations persistent from upgrades

You should take some care, since you can’t make these changes upgrade-safe, to make them simple to update after some upgrade breaks them.

My suggestion is that you change only a small detail in core. When you find the “requires” for those files:

require_once("modules/Calendar/CalendarUtils.php");

change it to this:

require_once(get_custom_file_if_exists"modules/Calendar/CalendarUtils.php"));

Then create copies of those required files under “custom” dir and make your edits there.

When an upgrade happens that changes any of these files, you should:

  1. Re-do the above change in the files “requiring”

  2. Check what changed in the new required files and merge those changes into your custom versions.

1 Like