10

As many know, it is possible to override templates, views, modules, components.

The main problem is when Joomla! is updated, and the items overriden (in the template folder) get outdated.

How do I keep the overrides updated each time an update is done to Joomla?

Do I need to do it by hand and check each new update, or is there some other way to do this?

4
  1. Write a small script which calculates md5 of original-files which you have done over-riding.
  2. Dump these file-path and MD5 into a file in your template
  3. Whenever joomla is updated, run the above script again.
  4. Check the difference in MD5, if any then you need to check it out.

Tip: Override the files only if those changes cannot be done by CSS overriding.

  • This seems a nice idea, but commenting the override will obviously make the md5 different compared to the updated/not updated ones that may come from an update, so this won't work. – jackJoe Apr 23 '14 at 6:58
  • 1
    I am asking to MD5 original files(from component view folder), not the overrides(files you created in template folder). – Shyam Apr 23 '14 at 7:40
  • 1
    Ah! I see! that way I can see which files I overrode changed with the update. That is a nice idea, I could use a versioning system and have a branch with just the overriden files, that way I don't really need to write any script. – jackJoe Apr 23 '14 at 7:45
12

When Joomla core is updated, no overrides in your template folder should be affected. That's why they exist.

On core Joomla items, overrides are going to only rarely conflict with Joomla core updates. When you override the Joomla core files, or any files, document document document. Commenting in the override file is CRITICAL if this is going to happen to you regularly and you admin more than one or two sites. You just won't remember what you changed!

Your code editor should have a "diff" feature, to compare the new file to the old and identify line by line what changes were made. If you've commented well, this diffing will show you exactly what was changed and if the file was affected by the update. Your only changes should be your overrides... anything else and you do have to go and re-override.

Third party overrides, however, become an issue only if the developer is not using the MVC structure correctly. If a component or module is laid out appropriately, the tmpl or view in question should not be affected by code updates.

If there is a major feature shift in that extension, you'll definitely need to document/comment and compare files.

  • One example of views overrides being affected by a core update was with Joomla 2.5.16 to 2.5.18, where I had the site broken due to the com_content component having an update in the views… The diff is what I use, but when having multiple overrides, it is tedious and with many different sites, very hard to do for each. – jackJoe Apr 22 '14 at 18:33
  • It's an interesting concept, to automatically diff files on update. The diff function exists in PHP. It can be done... by some developer other than me ;) – Toni Marie Apr 22 '14 at 18:43
3

Yes, you have to compare the files every time by hand and update the changes. On minor updates the chance is relatively small that you have to adjust them, but on major upgrades the overridden files can change significantly. I would also prefer an easier way, but it's the only solution ATM.

0

An override should not be changing in any Joomla version. However, if you find any files changed, what you could do is manage the whole Joomla installation in subversion.

You can then also manage the appropriate Joomla code versions in subversion and do a vendor-merge http://svnbook.red-bean.com/en/1.7/svn.advanced.vendorbr.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.