Upgrade Safe Development 101

So, I totally understand that for upgrade safe development, we need to make all changes in the custom folder and nearly no changes in the other folders. For some things, that people change a lot, this is really easy. For other things, I’m not sure how to accomplish this.

For example, I edited /include/Smarty/plugins/function.sugar_phone.php because I wanted to format telephone numbers with the “tel:” prefix for mobile use to make the numbers clickable.

What would I do in /custom/include/Smarty/plugins/function.sugar_phone.php to make this upgrade safe? Do I just create another file by the same name (or new name?) and include the non-custom file, the extend the class? But how do I basically replace the function that was in the original class with my function? And how do I ensure my php file gets “included”?

This is just an example, I have a bunch of other changes in non-custom folder that I’m hoping to move to custom folders… and figured the upgrade safe tutorial I’m hoping you’ll give me would apply to others as well.

sieberta

Hello,

yes that is the procedure

Create the same directory with the same structure and then copy the changed file to the directory there. As it is present in the core module.

After a quick repair, possibly JS / JS Languages Repair any changes should be taken.

This approach makes the change upgrade safe. It is important to look at the following upgrades, whether the change in the Custom folder leads to conflicts, if necessary, must be improved.

1 Like