2
votes

I'm developing an extension (module) that I want to be compatible with Joomla 1.5, 2.5 and 3.0 if possible. My main issue is getting around the different XML files needed. I decided to create a manifest.xml file for Joomla 1.5 with the <install> tag and a mod_mymodule.xml file for Joomla 2.5/3.0 with a <extension> tag with the mod_mymodule.xml containing fieldsets etc. whilst the manifest.xml contains the <params>.

My issue is that my extension installs absolutely fine on Joomla 3.0 (on localhost). However when installing on a Joomla 2.5, nothing showed up under the parameters. What is the priority for Joomla 2.5 and why it using the manifest.xml file with the install tags instead of the mod_mymodule.xml file?

Does Joomla 2.5 prioritize an <install> tag at the top of an XML file over another XML file in the same directory with an <extension> tag?

Manifest File:

<?xml version="1.0" encoding="utf-8"?>
<install type="module" client="site" method="upgrade" version="1.5">
    <name></name> 
    <author>George Wilson</author> 
    <creationDate>05-Mar-2012</creationDate> 
    <copyright></copyright> 
    <license>http://www.gnu.org/licenses/gpl-3.0.html</license> 
    <authorEmail></authorEmail> 
    <authorUrl></authorUrl> 
    <version>1.1.1</version> 
    <description></description>
    <files>
            <filename module="mod_mymodule">mod_mymodule.php</filename>
            <filename>manifest.xml</filename>
            <filename>index.html</filename>
            <filename>helper.php</filename>
            <folder>assets</folder>
            <folder>tmpl</folder>
    </files>

    <languages>
        <language tag="en-GB">language/en-GB/en-GB.mod_mymodule.ini</language>
    </languages>

    <params>
        <param name="blah" type="text" default="5" label="Label" description="Description" />
    </params>
</install>

mod_mymodule.xml file:

<?xml version="1.0" encoding="utf-8"?>
<extension type="module" client="site" method="upgrade">
    <name></name> 
    <author>George Wilson</author> 
    <creationDate>05-Mar-2012</creationDate> 
    <copyright></copyright> 
    <license>http://www.gnu.org/licenses/gpl-3.0.html</license> 
    <authorEmail></authorEmail> 
    <authorUrl></authorUrl> 
    <version>1.1.1</version> 
    <description>Description</description>
    <files>
            <filename module="mod_mymodule">mod_mymodule.php</filename>
            <filename>mod_mymodule.xml</filename>
            <filename>index.html</filename>
            <filename>helper.php</filename>
            <folder>assets</folder>
            <folder>sql</folder>
            <folder>tmpl</folder>
    </files>

    <languages>
        <language tag="en-GB">language/en-GB/en-GB.mod_mymodule.ini</language>
        <language tag="en-GB">language/en-GB/en-GB.mod_mymodule.sys.ini</language>
    </languages>

    <install>
        <sql>
            <file driver="mysql" charset="utf8">sql/install.mysql.utf8.sql</file>
        </sql>
    </install>
    <uninstall>
        <sql>
            <file driver="mysql" charset="utf8">sql/uninstall.mysql.utf8.sql</file>
        </sql>
    </uninstall>

    <config>
        <fields name="params">
            <fieldset name="basic">
                <field name="moduleclass_sfx" type="text" default="" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" />
            </fieldset>                 
        </fields>
    </config>
</extension>

Errors: Beneath position parameter: ( ! ) Notice: Trying to get property of non-object in ROOT\administrator\components\com_modules\views\module\tmpl\edit.php on line 50

Beneath ordering parameter ( ! ) Notice: Trying to get property of non-object in C:\wamp\www\joomla25\administrator\components\com_modules\views\module\tmpl\edit.php on line 61

It also says Module XML data not available at the bottom.

Update: Upon inspection it is definitely the manifest.xml file that is installing rather than the mod_mymodule.xml that I want the Joomla 2.5 to use.

2
which parameter you not seen component or module, you can use <install> tag but in parameter there are difference j 1.5 support parameters using <params> and j 2.5 using <config><fields> so try with these tags or give some example of your code of xmlsRakesh Sharma
Updated my question to specify its a module. My point is that in the manifest.xml I want for J1.5 compat so is using <params>. And the mod_mymodule.xml I want for J2.5/3.0 and is using <config><fieldset><fields>. However this isn't working in J2.5George Wilson
can i see your manifest and also your module files struture for 2.5Rakesh Sharma
Yeah will chuck it up tonight when I get back to my laptop I have it all stored on!George Wilson
@RakeshSharma put the file information you requested up. Removed some of the details. But the xml files are definately OK. Cause they install fine on Joomla 1.5 and Joomla 3.0. And the module installs without errors in 2.5. But then I find when I go to edit the module no params and the errors listed on the main postGeorge Wilson

2 Answers

1
votes

struture of both should be manifest.xml :-

<?xml version="1.0" encoding="utf-8"?>
<install type="module" version="2.5" method="upgrade">
     <name>my module</name> 
    <author>George Wilson</author> 
    <creationDate>05-Mar-2012</creationDate> 
    <copyright></copyright> 
    <license>http://www.gnu.org/licenses/gpl-3.0.html</license> 
    <authorEmail></authorEmail> 
    <authorUrl></authorUrl> 
    <version>1.1.1</version> 
    <description>Description</description>

    <!-- Installation -->   
    <!--<install>
        <sql>
            <file driver="mysql" charset="utf8">mod_mymodule/sql/install.mysql.utf8.sql</file>
        </sql>
    </install>
    <installfile>install/install.php</installfile>
    <uninstall>
        <sql>
            <file driver="mysql" charset="utf8">mod_mymodule/sql/uninstall.mysql.utf8.sql</file>
        </sql>
    </uninstall>
    <uninstallfile>install/uninstall.php</uninstallfile>

    <languages>
        <language tag="en-GB">language/en-GB/en-GB.mod_mymodule.ini</language>
        <language tag="en-GB">language/en-GB/en-GB.mod_mymodule.sys.ini</language>
    </languages>-->

    <!-- Modules -->
            <files folder="mod_mymodule">
                <filename module="mod_mymodule">mod_mymodule.php</filename>
                <filename>mod_mymodule.xml</filename>
                <!--<filename>index.html</filename>
                <filename>helper.php</filename>
                <folder>assets</folder>
                <folder>sql</folder>
                <folder>tmpl</folder>-->        
            </files>
</install>

And the module file should be module.xml

<?xml version="1.0" encoding="utf-8"?>
<extension type="module" client="site" method="upgrade" version="2.5">
    <name>my module</name> 
    <author>George Wilson</author> 
    <creationDate>05-Mar-2012</creationDate> 
    <copyright></copyright> 
    <license>http://www.gnu.org/licenses/gpl-3.0.html</license> 
    <authorEmail></authorEmail> 
    <authorUrl></authorUrl> 
    <version>1.1.1</version> 
    <description></description>
    <files>
            <filename module="mod_mymodule">mod_mymodule.php</filename>
            <filename>mod_mymodule.xml</filename>
           <!-- <filename>index.html</filename>
            <filename>helper.php</filename>
            <folder>assets</folder>
            <folder>tmpl</folder>-->
    </files>

    <config>
        <fields name="params">
            <fieldset name="basic">
                <field name="moduleclass_sfx" type="text" default="" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" />
            </fieldset>                 
        </fields>
    </config>
</extension>

hope this help you only change params for 1.5 teated on my demo and commit out if you want include some more file please create a module package and your sturuture sholu be

a. manifest.xml b. mod_mymodule (dir) and zip both in one. not add manifest in module folder

0
votes

Your second xml is missing the version (joomla! version, not your extension). Please see below:

    <extension type="module" client="site" method="upgrade" version="2.5">