upgrade joomla extension sql file doesn't gets executed - joomla

What is the difference between the usage of the install.sql file specified in extension manifest files on Joomla 1.5 and 1.6.
In 1.5, if you use method="upgrade" and the component is already installed, install.sql DOES get executed.
In 2.5, if you use method="upgrade" and the component is already installed, install.sql DOES NOT get executed.
Does anyone know if this change was intentional?

It is deliberate as from 1.6 up there is now a update tag for sql:
//executed when component is installed for the first time
<install folder="admin">
<sql>
<file driver="mysql" charset="utf8">sql/example.install.sql</file>
</sql>
</install>
//executed when component is uninstalled
<uninstall folder="admin">
<sql>
<file driver="mysql" charset="utf8">sql/example.uninstall.sql</file>
</sql>
</uninstall>
//executed when the component is installed over an existing version
//or updated through the Joomla Update Manager
<update>
<schemas>
<schemapath type="mysql">sql/updates/mysql</schemapath>
</schemas>
</update>
See the Joomla 1.6 wikipage on the manifest.xml structure here for more information on this

Related

Show NuGet package release notes

The nuspec reference says about the releaseNotes tag
v1.5 A description of the changes made in each release of the package. This field only shows up when the Updates tab is selected and the package is an update to a previously installed package. It is displayed where the Description would normally be displayed.
I created two nuspec files, both containing (with different version tags of course)
<?xml version="1.0"?>
<package >
<metadata>
<id>TestReleaseNotes</id>
<version>1.0</version>
<authors>adrianm</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Description</description>
<releaseNotes>Release notes</releaseNotes>
</metadata>
<files>
<file src="Test.cs" target="content" />
</files>
</package>
I installed 1.0 in VS2013 and selected the update tab but I can't see the release notes.
What am I missing?
Found this out myself.
The release notes are displayed if I open the "Manage NuGet packages" dialog from the project.
but not when I open it from the solution.
The behaviour is the same for my own packages as well as nuget.org
This still seems to be an issue in Visual Studio 2019 as at March 2021.
We publish a number of nuget packages internally using Azure. The Package Release Notes show up in the Azure UI but not in Visual Studio. However, the "Description" does show up in Visual Studio, so I've tweaked the Description to include the release notes. This is actually from the Directory.build.props file, but could equally well be embedded in the project file:
<PackageReleaseNotes>
Release notes added to .nuspec file as <Release Notes> and also to end of Description
</PackageReleaseNotes>
<!-- Don't indent text, it makes it hard to read in the nuget package manager-->
<Description>
Description:
This is the description of our internally produced nuget package
Release Notes:$(PackageReleaseNotes)
</Description>
This issue is tracked in the NuGet repo regarding VS2015.
https://github.com/NuGet/Home/issues/1823

Joomla 3: How to uninstall module from a package?

In my package, I have a module and a plugin. When I uninstall a package from the Extension Manager, the plugin gets uninstalled but the module remains there. Also the package entry gets removed from the Extension Manager. Then I have to manually uninstall the module. I get the following messages:
Warning
Attempting to uninstall unknown extension from package.
This extension may have already been removed earlier.
Message
Uninstalling package was successful.
How do I ensure the module gets uninstalled when I uninstall the package?
UPDATE:
My package manifest:
<?xml version="1.0" encoding="UTF-8" ?>
<extension type="package" version="3.0">
<name>RR Test One Package</name>
<author>John Doe</author>
<creationDate>November 2013</creationDate>
<packagename>rr_test_one_package</packagename>
<version>1.0</version>
<packager>John Doe</packager>
<description>Lorem ipsum dolor sit amet.</description>
<files folder="packages">
<file type="module" id="rr_test_one" client="site">mod_rr_test_one.zip</file>
<file type="plugin" id="rr_test_one" group="content">plg_content_rr_test_one.zip</file>
</files>
</extension>
I have script.php inside the plugin and module folders to make some updates to the database entries. The plugin uninstalls without the uninstall function when I uninstall the package. It's just not uninstalling the module. Do I need to have another script.php in the packages folder along with the package manifest and have the uninstall function in the script.php?
It was the id in the <file> tag of the module type that was giving out the warning. I added mod_ in the id. Below is what I did and this resolved the issue.
<files folder="packages">
<file type="module" id="mod_rr_test_one" client="site">mod_rr_test_one.zip</file>
<file type="plugin" id="rr_test_one" group="content">plg_content_rr_test_one.zip</file>
</files>

Joomla Module: How to read ini language strings from XML module file?

mod_modulo.xml file:
<?xml version="1.0" encoding="utf-8"?>
<install type="module" version="1.5.0">
<name>**EXTNAME**</name>
<description>**EXTDESCR**</description>
<files>
.
.
.
</files>
<languages>
<language tag="en-US">languages/en-US.mod_modulo.ini</language>
<language tag="es-ES">languages/es-ES.mod_modulo.ini</language>
</languages>
</install>
es-ES.mod_modulo.xml:
EXTNAME=Mi modulo
EXTDESCR=Descripcion de mi modulo va aqui
I am using Joomla!1.5 to develop modules because I think that newer versions of Joomla are compatible with older modules. Anyway, the question is: How can I set the values of name and description in mod_module.xml to the strings found in the corresponding language file ?
Joomla 1.5's component installation manifest definition includes a section for administrator interface language files:
...
<administration>
<languages folder="administrator/language/">
<language tag="en-GB">en-GB/en-GB.com_my.ini</language>
<language tag="es-ES">es-ES/es-ES.com_my.ini</language>
</languages>
</administration>
...
However, this specification does not work for modules in that version.
The Document type definition used by J1.5's manifest files is no longer served.
Thant's why I am not sure whether the failure to copy the language files to the admin section's folder is a bug or is done by design. Their removal during the uninstallation process indicated that it is indeed a bug.
Joomla! v1.5 module installation is performed by libraries/joomla/installer/adapters/module/php.
This file is not accessing this node during the installation, but is deleting it during uninstall it deletes it:
$this->parent->removeFiles($root->getElementByPath('administration/languages'), 1);
What can you do?
Legacy packages support in 2.5 and 3.x requires compromises. I would personally advise against it, as it cripples your design.
Therefoe, you can either write a Joomla! 2.5+ module, or you can try to hack your way around this, which would not be pretty. Modules don't event have installation scripts, so you cannot even copy the language files during the module installation process.
The first thing that comes to mind is copying the language files to the administrator folder the first time the controller is invoked.
All this should, hopefully, convince you (and anyone reading this post) to switch to the current Joomla! version.
Try this,
In your xml file
<languages>
<language tag="en-US">languages/en-US.mod_modulo.ini</language>
<language tag="es-ES">languages/es-ES.mod_modulo.ini</language>
</languages>
in your mod_modulo.ini file
EXTNAME="Mi modulo"
EXTDESCR="Descripcion de mi modulo va aqui"
in your default.php file have.
echo "Name :".JText::_('EXTNAME');
echo "Description:".JText::_('EXTDESCR');
Hope its help you..

Change the location of packages for NuGet using the release note 2.1 doesn't work

I am trying to change the location of the default package folder for NuGet
I read many posts including the documentation of the NuGet 2.1 Release Notes, the new config for NuGet version 2.1 as the following:
<configuration>
<config>
<add key=" repositoryPath" value=" C:\myteam\teampackages" />
</config>
...
</configuration>
I also read the following thread, Is it possible to change the location of packages for NuGet?
But this configuration doesn't work?
The only config work is the old one which is as the following:
<settings>
<repositoryPath>C:\myteam\teampackages</repositoryPath>
</settings>
I am using Visual Studio 2012 Update 1 that including NuGet Package version 2.1
Steps to reproduce:
in solution directory, create a file "nuget.config"
edit nuget.config and add:
<settings>
<repositoryPath>C:\myteam\teampackages</repositoryPath>
</settings>
Delete the default packages folder
In visual studio, right-click on Solution, and select Manage NuGet
Packages Install a package (any package)
Verify that package was downloaded to C:\myteam\teampackages
delete the downloaded package in C:\myteam\teampackages
change the nuget.config to the following:
<configuration>
<config>
<add key="repositoryPath" value="C:\myteam\teampackages" />
</config>
</configuration>
Try to install any library again.
I find the library installed in the packages folder not my folder???
>>steps to reproduce:
>>in solution directory, create a file "nuget.config"
From the release notes it looks for nuget.config in the following order
.nuget\nuget.config
Recursive walk from project (.nuget) folder to root
Global nuget.config (%appdata%\NuGet\nuget.config)
So if nuget.config is in the project/solution folder it won't be honored. Can you try moving it to .nuget folder and reload the solution.
It works when you place a \ at the end of the path:
<add key=" repositoryPath" value="C:\myteam\teampackages\" />

What is the proper way to remove/uninstall specific packages from my WiX Burn bundle?

I have packages that I would like to remove from subsequent releases. What is the proper way to have this package uninstalled from user machines during future updates? (IE: Remove Package_B below).
I have tried removing the package entry from the bundle and progressed the bundle version, which was the answer in this SO question, but that did not work for me.
<?xml version="1.0">
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle>
<Chain>
<ExePackage
Id='Program_A'
SourceFile='$(var.Program_A.TargetDir)\Program_A.exe'
Cache='no'
Permanent='yes'
PerMachine='yes'
Vital='yes'
/>
</ExePackage>
<ExePackage
Id='Program_B'
SourceFile='$(var.Program_B.TargetDir)\Program_B.exe'
Cache='no'
Permanent='yes'
PerMachine='yes'
Vital='yes'
/>
<RollbackBoundary/>
<MsiPackage
Id='Microsoft_InstallerPkg1'
SourceFile='$(var.Microsoft_InstallerPkg1)'
Cache='yes'
Permanent='yes'
Vital='yes'
>
</MsiPackage>
<RollbackBoundary/>
<Chain>
</Bundle>
</Wix>
Try this
Include same exe packages inside new bundle.
Set DetectCondition to
detect existence of to be deleted package. //It must be evaluates to
true.
Provide UninstallCommand. //It is also necessary otherwise
the package will be executed with default params (which are normally
install by default)

Resources