I try to create 2 tables for a component I m writing for joomla. I have in the xml file:
<install> <!-- Runs on install -->
<sql>
<file driver="mysql" charset="utf8">sql/install1.mysql.utf8.sql</file>
</sql>
<sql>
<file driver="mysql" charset="utf8">sql/install2.mysql.utf8.sql</file>
</sql>
</install>
But it installs only the first file hence the first table. And if I put all the sql commands in one line I get an error from joomla:
JInstaller: :Install: Cannot find Joomla XML setup file
What am i doing wrong?
Thanks for the help,
John.
Ok,
I found the problem. In fact, I was using the wrong collation in my database :(
Related
I ran into a typical scenario where it required to change product name as supplied from command line parameters as below
MSBuild.exe ApplicationSetup.wixproj /p:AssemblyTitle=%USER_SPECIFIED_NAME% /p:ProductVersion=%VERSION% /p:ProductCode=%PRODUCT_CODE% /p:UpgradeCode=%UPGRADE_CODE% /t:Clean;Rebuild"
I am using those supplied parameters in .wxi file. as below :
<Product Id="$(var.ProductCode)" Name="$(var.AssemblyTitle)" Language="4"
Version="$(var.BuildVersion)"
Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
This code compiles successfully. But the name of product in add/remove program is not reflecting correctly. I read that Product name cannot be supplied directly, it should be hard coded.Please advise on this.
Another typical requirement is to have multiple version installed of same product on a machine. I somewhat achieved this by doing following change in Product tag in .wxi file
<Product Id="*" Name="$(var.AssemblyTitle)" Language="4"
Version="$(var.BuildVersion)"
Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
Now here come the issue that second installation will overwrite the file generated during first installation. So it is required to change install directory dynamically.
I have posted this after struggling for couple of days and tried many solution, but all in vain. Any help will be highly appreciated.
I am using Propel 2 with Postgres database. When I run the following command, it appears to work, but in the generated schema.xml file, I do not get any column information:
vendor\bin\propel reverse -v --verbose "db"
Reading database structure of database `db` using dsn `pgsql:host=localhost;dbname=db`
SchemaParser `Propel\Generator\Reverse\PgsqlSchemaParser` chosen
Successfully reverse engineered 8 tables
Writing XML file to generated-reversed-database\schema.xml
Schema reverse engineering finished.
The generated schema.xml looks like this:
<?xml version="1.0" encoding="utf-8"?>
<database name="db" defaultIdMethod="native" defaultPhpNamingMethod="underscore">
<table name="sometable" idMethod="native" phpName="SomeTable">
<unique name="sometable_name_key">
<unique-column name="name"/>
</unique>
</table>
... other tables, no columns here ...
</database>
I am completely stumped on why this is happening. Any help is appreciated.
I'm trying to upload my hand-coded template to Joomla 2.5.
I have moved it to the templates folder online. Now I'm trying to INSTALL it from Extension Manager > Install (I see the path to it in the textbox against the Install button). But upon clicking the button, I get this error:
-1 - An error has occurred.
Copy failed
Here's my XML file:
<?xml version="1.0" encoding="utf-8"?>
<extension version="2.5" type="template">
<name>Travels</name>
<description>
Template for Target Travels
</description>
<files>
<filename>index.php</filename>
<filename>catergory.php</filename>
<filename>templateDetails.xml</filename>
<filename>css/template.css</filename>
<filename>css/mystyle.css</filename>
<filename>css/common.css</filename>
<filename>css/crasel.css</filename>
<filename>css/jquery.jcarousel.css</filename>
<filename>css/skin.css</filename>
<folder>css</folder>
<folder>images</folder>
</files>
<positions>
<position>breadcrumb</position>
<position>welcome</position>
<position>tour_catergory</position>
<position>left</position>
<position>right</position>
<position>top</position>
<position>user1</position>
<position>user4</position>
<position>footer</position>
</positions>
</extension>
Any idea on the cause and how to fix it?
This is usually due to permission issues with folders. In the Joomla backend go to:
Site (top menu) >> System Information >> Directory Permissions and ensure the "templates" folder is writable. Whilst you're at it, ensure all folder and files in the list are writable.
Hope this helps
If your template is already in place you should use discover install not install from directory. You have no need to copy files if the files are already where they need to be.
I create a new plugin for joomla 2.5, and in xml i use:
<description>PLG_VAR_DESC</description>
But when install, he dont show the the translation but the var on file.
<languages folder="">
<language tag="en-GB">en-GB.plg_system_name.ini</language>
<language tag="en-GB">en-GB.plg_system_name.sys.ini</language>
</languages>
<files>
<folder>images</folder>
<filename>index.html</filename>
<filename>parameters.xml</filename>
<filename plugin="plg_name">plg_name.php</filename>
</files>
I try everything but i cant put this work..
Thanks
Under the administrator panel in Joomla! you can find under Site - Global configuration - System:
This will allow you to see the Joomla! Debug console:
There you can see if the language file your are using is loaded. If it's not loaded, than your manifest file is not consistent.
I think that the problem could be solved with:
<languages folder="admin">
instead of
<languages folder="">
Also for your reference, the Joomla! documentation on "Specification of language files" may be a good read.
I found the problem.. is the name of language file. Thank's for helping me
Is it possible in joomla install.xml file write some sql, which would be executed on install? Or somehow else do this trick? The point is that i have written custom authorization plug-and i have to disable/replace/delete an existing one.
You could use external SQL-files and make them execute on install.
1. Create a SQL-file install.mysql.utf8.sql in your plugin root with some content like:
CREATE TABLE IF NOT EXISTS `#__tablename` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;
2. In your XML-manifest add the file as a filename node underneath files:
<files>
<filename>install.mysql.utf8.sql</filename>
</files>
3. Add a install node in your manifest that tells Joomla what SQL file to execute on installation:
<install>
<sql>
<file driver="mysql" charset="utf8">install.mysql.utf8.sql</file>
</sql>
</install>
If you install the plugin with this and it's a new installation (the plugin havn't been installed on the site before) then Joomla will execute the SQL-file.
If you need to execute SQL on a upgrade (reinstallation) of the plugin you'd have to use the update node.
An alternative to SQL-files is to use PHP-scripts to be executed (which can run SQL queries themselves) on install/update. For help with that, see this.