I want to modify a Joomla extension code. I know how to use template overrides, but the extension is not written in MVC pattern and even if it was, I would be going to change the controller code. In fact I'm going to modify a specific method in a class. How can I do this change without worrying about an update of the extension in future overriding my changes? And what about adding funationality and parameters? I may want to publish my changes back to the community. How can I do that?
Asked
Active
Viewed 107 times
1 Answers
0
If the component does not use Joomla's MVC pattern, it will be nearly impossible to make own update-safe overrides. Ask the developer why he is not willing to learn MVC before developing components... On the other hand, each component has to use the basics of Joomla's MVC in order to work. So you can always use core overrides, but have to override the whole class. Take a look at this document, it will explain how to override model and controllers:

Jordan.J.D
- 7,999
- 11
- 48
- 78

Andreas
- 736
- 6
- 15
-
Thanks you @Andreas. I saw your link. Nice documentation for overriding MVC extensions. But do you mean I should write my own extension utilizing the given extension code as a base code? and then can I publish it as my own code? – Mohsenme May 21 '13 at 10:13
-
Your first question is hard to answer. This really depends on what you are trying to achieve: If you want to use the component as a template to built your own, significantly different application, then you should definitely copy the whole extension. If you instead just want to introduce some improvements without touching the core functionality, you should go with the above-mentioned override method. – Andreas May 22 '13 at 17:49
-
And your second question: every extension should have some licensing information stored in the component's XML. In most cases you are allowed to modify the code but you have to attribute the original author in some way. Additionally, most times you have to publish your extension using the same license. – Andreas May 22 '13 at 17:52