Convert module from 1.5 to 2.5 version - joomla

Have been Googling for hours to find the solution on how to convert my modules from Joomla version 1.5 to 2.5.
The modules doesn't show up in the administrator area under "Extensions > Module Manager".
Where should I start and how should I do to migrate my modules?

Updating fairly simple modules to be 2.5 compatible is very simple. The first thing you start with is the XML file.
<install version="1.5"> needs to be replaced with <extension version="2.5">
The same goes for the tag at the very end: </install> to </extension>
Then, you will need to start with the parameters. Each parameter is defined with <param> and needs to be changed to <field>. However a little more needs to be added to the beginning and end of the fields as shown below:
Updating fairly simple modules to be 2.5 compatible is very simple. The first thing you start with is the XML file.
<install version="1.5"> needs to be replaced with <extension version="2.5">
The same goes for the tag at the very end: </install> to </extension>
Then, you will need to start with the parameters. Each parameter is defined with <param> and needs to be changed to <field>. However a little more needs to be added to the beginning and end of the fields as shown below:
<config>
<fields name="params">
<fieldset name="basic">
//Fields go in here
</fieldset>
</fields>
</config>
Also, if you are using language files, you will need to copy and paste the following one you have and add .sys into the name like so en-GB.mod_example.sys.ini. Then open this file and ensure that the description of the module is the only translation in the file. Once done, specify the language file in the XML. Don't forget that language file's for Joomla 2.5 don't support # at the beginning of the data lines, and will need to be replaced with ;
It might also be an idea to keep up to date with any functions that are removed or deprecated.
Hope this helps.

Modules, Components and Plugins are all extensions, with different purposes.
As mentioned by #Irfan already check the Joomla! Documentation pages:
Adapting a Joomla 1.5 extension to Joomla 1.6
Joomla! Manifest files
As mentioned before it may work just by updating the manifest file (xml file) for the module. If it's a component things can get more complicated.
As a side-note, the more vague are about your problem, the more vague will the answers be. Get back to us with more details (like component name or errors that you get).

Related

Specify multiple versions in manifest file

I've developed an extension(component + plugin) that is compatible with both joomla versions 2.5 and 3.0.
Now, my question is how to declare the version attribute in extension tag in manifest file, since same extension will be used for joomla 2.5 and 3.0 installs. Or does it not matter?
<extension version="2.5" ... ></extension>
<extension version="3.0" ... ></extension>
Although during install, it doesn't create any problem, as I've tried setting it to 2.5 for joomla 3.0 also
Thanx in advance...
Ok, so not having received even a single response in so much time, I checked the versions mentioned in other commercially successfdully extensions from joomla site those were supporting both the joomla versions, and found out that they were mentioning 2.5.
Hence, im going by the same...

Joomla 2.5 component upgrade while keeping file unchanged

I have wrote a custom joomla 2.5 component and I its deployed on various sites with each having its own style sheet changed on server.. is there a way I can keep upgrading the component (add new features etc) but make sure that a specific css file is not not changed? i.e. remains the same as updated on each website?
Considering you have the xml file correctly set to method upgrade <extension type="component" version="1.6.0" method="upgrade"> just skip the <folder>css</folder> on your upgrade package.
<files folder="site">
<filename>index.html</filename>
<filename>keywords_editor.php</filename>
<filename>controller.php</filename>
<filename>router.php</filename>
<folder>views</folder>
<folder>css</folder> // This should not be included in your case
<folder>models</folder>
<folder>controllers</folder>
<folder>helpers</folder>
</files>
As Valentin mentions, the old files will remain on server if you're doing an upgrade to the component and not a fresh install.

joomla 3.0 extension manager not finding update of module

I developed a module that can be updated in Joomla 2.5 Extension Manager.
I can't find information anywhere that indicates that something needs to be different in order to work properly in Joomla 3.0
I don't intend to advertise this module by providing the link to it, I'm just trying to find help to fix this problem.
Here is the page where you can download it:
http://code.google.com/p/mod-random-article/downloads/list
If you install v1.1 on Joomla 2.5, the Extension Manager will find the new update v1.2.
If you install it on Joomla 3.0, the Extension Manager won't find the new version.
Can anyone help?
Thanks
I found the solution for my problem.
This looks so easy.. I don't know how I couldn't find this earlier.
I had to add another tag to the manifest file on the update server targeting Joomla 3.0, like this:
<updates>
...
<update>
...
<targetplatform name="joomla" version="3.0"/>
...
</update>
</updates>
I had renamed everything to the respective plugin name but still joomla wasn't finding the new copied and modified plugin that I had created.
Finally I found out that the plugin attribute of the XML object, needs to be the same name that of the plugin. So lets say that the new plugin name is xxyyzz, As shown below with the other respective changes, the plugin attribute should also be updated.
<files>
<filename plugin="xxyyzz">xxyyzz.php</filename>
</files>

How to correctly set the dependecies settings when generating packages

I'm relatively new to modules development on Magento 1.6.2, I have to modules :
Company_JQueryUI (adds jqueryui + theme files to the Adminhtml heading)
Company_Slider (A simple image slider with file upload)
These modules I made work fine on the development environment and I've been asked to generate them separately, in a way that any modules that requires JQueryUI on the backend should activate it on demand and requires it in the installation process.
I've followed the wiki page concerning the packaging phase, on the dependencies tab I've set the following :
Package : Company_JQueryUI
Channel : community
Min : 1.1.0
Max : 1.1.0
Files : (I really don't know whether this field is required and what should I put there, but the wiki just ignores this part.
All the other settings are correctly set.
The problem is that when I start the installation process of the slider module, Magento Connect doesn't generate any exception regarding the missing dependency, So I though maybe I need to set the dependency in the /etc/moduels/Company_Slider.xml
<?xml version="1.0"?>
<config>
<modules>
<Company_Slider>
<active>true</active>
<codePool>local</codePool>
<depends>
<Company_JQueryUI />
</depends>
</Company_Slider>
</modules>
</config>
But then I got a bigger problem, Magento Connect still ignores the dependency on the deployment phase, but once it's done, it generates an exception, and the website is put on maintenance mode, blocking any access to it, and Showing the dependency exception on a blank page (Magento Connect).
So far all I could do is remove the module files manually to get the site working again, I don't know if I'm missing something or it's a bug in the deployment process.
PS : bug resolved in 1.7

How do I know whether my Config.xml file is working in Magento?

I have created a sample module, but I am not sure if its /module/etc/config.xml file is getting loaded. I am sure there is a problem in that only. Is there a way that I can find out whether this file is getting loaded?
The free Module List module (built by me) will tell you which module's are installed in the system, and will tell you if your config.xml is being loaded.
If you have a good debugger Xdebug or Zend Debugger, you can check the variable $mergeToObject in the method loadModulesConfiguration of the class Mage_Core_Model_Config.
Or the bad guy way :-), you die the script at the same place but just before return $mergeToObject; you do print_r($mergeToObject);.
You could see in this method if your module is loaded too.
A debugger is your best friend. ;-)
All of this allow to check what is loaded from your config.xml but doesn't mean that the syntax is correct into your config.xml to load models or else. You should take a look in other config.xml of the core modules to help you.
I have forgotten, check if you module is correctly loaded and recognized by Magento after a cache flush, you should take a look in the System > configuration > advanced tab and see if your module name appears.
Drop this in the bottom of your index.php, similar to Alans Module List but a quick code copy/paste approach. Remember all of Magento's XML's get combined into one XML tree.
header("Content-Type: text/xml");
die(Mage::app()->getConfig()->getNode()->asXML());
As long as you have Your_Module.xml in app/etc/modules/ and it is enabled (might have to flush the cache if you have caching enabled), app/code//Your/Module/etc/config.xml is one of the most sure things that will load. Other files may not for different reasons, but that one will always load. Whether or not it's properly set up to let your module work is an entirely different story though. I've spent plenty of time debugging a config.xml file to find some minor spelling error was the reason my module wasn't working.
Alternatively, you could throw some invalid XML into it and see if Magento borks out.

Resources