What I found out the hard way
Sometimes or more often i stumble over a hurdle where the solution is hard to find (for me) . Here i will present some of the solutions
Sometimes or more often i stumble over a hurdle where the solution is hard to find (for me) . Here i will present some of the solutions
Instead of using the matching sql file for the joomla component the database update began with the first one.
In the manifest file following part was used for the first time
<update> <!-- Runs on update; New in 2.5 -->
<schemas>
<schemapath type="mysql">sql/updates/mysql</schemapath>
</schemas>
</update>
in this case the table "#__schemas" is asked for an entry of the component with the actual version. In my case there was no entry for my component and the database update began with version one of the sql files.
Inside the installation script we can set set the version if it doesn't exist.
public function preflight($type, $parent)
{
if ( $type == 'update' )
{
$this->oldRelease = $this->getParam('version');
//--------------------------------------------------------------------------------
// Check if version is already set in "_schemas" table
// Create table #__schema entry fpr rsgallery if not used before
//--------------------------------------------------------------------------------
//--- Determine extension id ------------------
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select($db->quoteName('extension_id'))
->from('#__extensions')
->where($db->quoteName('type') . ' = ' . $db->quote('component')
. ' AND ' . $db->quoteName('element') . ' = ' . $db->quote('com_myComponent')
. ' AND ' . $db->quoteName('name') . ' = ' . $db->quote('com_myComponent'));
$db->setQuery($query);
$ExtId = $db->loadResult();
//--- Read SchemaVersion ------------------
/*
$query->clear();
$query->select($db->quoteName('version_id'))
->from('#__schemas')
->where($db->quoteName('extension_id') . ' = ' . $db->quote($ExtId));
$db->setQuery($query);
$SchemaVersion = $db->loadResult();
*/
//--- Check if entry in _schemas table exists ------------------
$query->clear();
$query->select('count(*)');
$query->from($db->quoteName('#__schemas'))
->where($db->quoteName('extension_id') . ' = ' . $db->quote($ExtId));
$db->setQuery($query);
$SchemaVersionCount = $db->loadResult();
// component entry does not exist
if($SchemaVersionCount != 1)
{
// Create component entry (version) in __schemas
$query->clear();
$query->insert($db->quoteName('#__schemas'));
$query->columns(array($db->quoteName('extension_id'), $db->quoteName('version_id')));
$query->values($Rsg2id . ', ' . $db->quote($this->oldRelease));
$db->setQuery($query);
$db->execute();
// example UPDATE #__schemas SET version_id = 'NEWVERSION' WHERE extension_id = 700
}
}
}
Fehlermeldung bei der Installation eines Joomla Moduls/Komponente: "Modul Installieren: Das Verzeichnis wird bereits von einem anderen Modul genutzt!: ".../administrator/modules/mod_Rsg2SummaryTreeView".
Ich hatte mehrfach installiert und deinstalliert. Dabei ist wohl etwas falsch gelaufen. Dann löschte ich die mir bekannten Verzeichnisse und bekam immer noch obeigen Fehler. Ich fand Reste der Installation im ".../cache" Verzeichnis und löschte diese. Danach liess es sich wieder normal installieren.