?
avatar Serhioromano
Serhioromano
29 Mar 2013

I have already posted this issue 3 month ago and now they ask me to move this issue here.

Issue tracker reference

Although it used to work with Joomla 2.5. Here is my discovery.

Before in manifest I used this and it worked.

<install>
    <sql>
        <file driver="mysql" charset="utf8">components/com_cobalt/fields/multilevelselect/sql/install.field.multilevelselect.sql</file> 
    </sql>
</install>

It did not work in Joomla 3.0 and I found that file libraries/joomla/installer/installer.php on line 888 has this.

$sqlfile = $this->getPath('extension_root') . '/' . $file;

So $sqlfile = $this->getPath('extension_root') returns /Users/joomla30/administrator/manifests/files/multilevelselect/ which is not exist. In fact even /Users/joomla30/administrator/manifests/files/multilevelselect.xml does not exists at this moment.

To get around I tried to change <file> like this

<install>
    <sql>
        <file driver="mysql" charset="utf8">../../../components/com_cobalt/fields/multilevelselect/sql/install.field.multilevelselect.sql</file>
    </sql>
</install>

so total of $sqlfile = $this->getPath('extension_root') . '/' . $file; would be

/Users/joomla30/administrator/manifests/files/multilevelselect/../../../components/com_cobalt/fields/multilevelselect/sql/install.field.multilevelselect.sql

but since /Users/joomla30/administrator/manifests/files/multilevelselect/ is non-existent it returns error on Unix type systems.

I mean even if I try in terminal

cd /Users/joomla30/administrator/manifests/files/multilevelselect/../../../components/com_cobalt/fields/multilevelselect/sql/

It will return that directory does not exists.

I get this error on install

Screen Shot 2012-12-21 at 9 39 10 PM

And this when try to uninstall

Screen Shot 2012-12-21 at 9 38 36 PM

And this problem only with file type installation

<extension version="3.0" type="file" method="upgrade">
avatar Serhioromano Serhioromano - open - 29 Mar 2013
avatar nicksavov
nicksavov - comment - 29 Mar 2013

Great, thank you Sergey!

avatar Serhioromano
Serhioromano - comment - 1 Apr 2013

Unfortunately it was closed on Joomlat racker. it is stated that this feature was taken out for a reason. Although i do not see any reason to lose this feature in Joomla 3.0, this is very pity. I was waiting for this feature for years and was ver glad when it worked in Joomla 2.5. Ad a Joomla extensions developer I personally think it is very strong feature and expected behavior. When you create manifest file you expect it to work as in component as in file type. I do not see any difference.

avatar mbabker
mbabker - comment - 1 Apr 2013

It was not taken out of J! 3, but instead a change to where in the file structure that certain files are executed from was made for the files adapter. In 2.5 and earlier, the files installer would not copy over certain files and assumed that everything was at the site root. For consistency in behavior, a change was made so that utility files (the manifest script, SQL files, etc.) are copied over to /administrator/manifests/files. This requires a change in packaging your files extensions between 2.5 and 3.0 if you're using an install script or SQL files, but the features are present.

avatar mbabker
mbabker - comment - 1 Apr 2013

Please see joomla/joomla-platform#1345 for more info.

avatar zero-24 zero-24 - close - 1 Apr 2013
avatar mbabker mbabker - close - 1 Apr 2013
avatar Serhioromano
Serhioromano - comment - 2 Apr 2013

I am greatly apologize, but I cannot make it work. What would be the XML manifest example for SQL file to be triggered on file type installation?

avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?
Removed: ? ?
Build staging
avatar pjdevries
pjdevries - comment - 10 Aug 2015

Hey Sergey. Dit you ever get a satisfactory answer to your question? I am trying to figure out exactly the same thing :)

Add a Comment

Login with GitHub to post a comment