Upgrading version with custom code?

Upgrading version with custom code?

James Muehlner -
回帖数:2
I have a moderatly heavily modified moodle installation, and everything is working in 1.6. (I've changed code in around 30 files or so)

The functionality in 1.7 will be very useful for my application, so I (or someone else probably) will be upgrading this installation.

I've clearly marked all of the changes to the code, but upgrading versions looks like it's still going to be a time-consuming proccess of following the ideas of the old modified file, and copy-pasting as much as possible into the new files.

I got everything working in 1.7 beta in around 1.5 hours or so, but it's going to be harder for others who don't understand my code.

So basically, does anyone know of an easier way to do this? I know that this is a very open-ended question, but I don't know of any better way to ask it. Any help would be very appreciated.

Thanks.
回复James Muehlner

Re: Upgrading version with custom code?

Jan Dierckx -

Tell us some more about which modifications you are talking about. If your modifications are really important, chances are someone else will want them as well. Maybe you could show them to the community and that way they might make it in a Moodle release. 微笑

Just a few things to bear in mind:

  • (I guess you already know this, but just to be complete) use CVS to upgrade your site. It will leave all of your own modifications untouched, unless there is a conflict with the new Moodle code, then it will report what has changed. That way you only need to manually update those files... You can use a diff utility or an editor with such functionality to show the new and old version side by side.

  • try to customize as much as possible by using themes or the plugins Moodle provides. The assignment module can be extended using plugins. Then your own changes to the assignment module will all be inside an assignment type. When there are updates to the assignment module, these will not directly affect your own assignment type.

  • The same goes for resource types. You can add all kinds of resource types without having to manually patch the resource module code everytime you update. The database module can be extended using preset templates / extra fieldtypes. New course formats can be added etc...

  • A lot of site customization can also be done using themes and language packs. Once again, you can create your own language pack, so your changes are not harmed when you do an upgrade.

回复Jan Dierckx

Re: Upgrading version with custom code?

James Muehlner -
Thanks for the info!

I actually didn't know about CVS to upgrade. I'll have to look into it.

The Moodle system we are using is being modified to do something a bit different than what it was originally intended for. Without going into too much detail, I don't think that most of the mods I have done would be appropriate to anything but our specific application.

Most of my mods are little hacks (a dozen lines here and there) to certain files in the system to change the functionality just a little, to make it work the way we want, which is most likely not the way others would want it to work.

I certainly do appreciate the modularity of the moodle system: that has been a great help! approve