I have already posted this issue 3 month ago and now they ask me to move this issue here.
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
And this when try to uninstall
And this problem only with file type installation
<extension version="3.0" type="file" method="upgrade">
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.
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.
Please see joomla/joomla-platform#1345 for more info.
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?
| Labels |
Added:
?
Removed: ? ? |
||
| Build | ⇒ | staging | |
Hey Sergey. Dit you ever get a satisfactory answer to your question? I am trying to figure out exactly the same thing :)
Great, thank you Sergey!