mirror of
https://github.com/e107inc/e107.git
synced 2025-07-30 11:20:25 +02:00
Plugin Table Insert fix (should prevent errors). Added check for deprecated releaseUrl field to update routine.
This commit is contained in:
@@ -986,7 +986,7 @@ function update_706_to_800($type='')
|
||||
|
||||
|
||||
//TODO - send notification messages to Log.
|
||||
|
||||
|
||||
|
||||
if($sql->field('page','page_theme') && $sql->gen("SELECT * FROM #page WHERE page_theme != '' AND menu_title = '' LIMIT 1"))
|
||||
{
|
||||
@@ -1004,6 +1004,16 @@ function update_706_to_800($type='')
|
||||
|
||||
}
|
||||
|
||||
if($sql->field('plugin','plugin_releaseUrl'))
|
||||
{
|
||||
if ($just_check) return update_needed('plugin_releaseUrl is deprecated and needs to be removed. ');
|
||||
if($sql->gen("ALTER TABLE `#plugin` DROP `plugin_releaseUrl`"))
|
||||
{
|
||||
e107::getMessage()->addDebug("Successfully removed plugin_releaseUrl. ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// --- Notify Prefs
|
||||
|
||||
|
@@ -366,8 +366,20 @@ class e107plugin
|
||||
|
||||
$_installed = ($plug_info['@attributes']['installRequired'] == 'true' || $plug_info['@attributes']['installRequired'] == 1 ? 0 : 1);
|
||||
|
||||
if (e107::getDb()->db_Insert("plugin", "0, '".$tp->toDB($pName, true)."', '".$tp->toDB($plug_info['@attributes']['version'], true)."', '".$tp->toDB($plugin_path, true)."',{$_installed}, '{$eplug_addons}', '".$this->manage_category($plug_info['category'])."' "))
|
||||
{
|
||||
|
||||
$pInsert = array(
|
||||
'plugin_id' => 0,
|
||||
'plugin_name' => $tp->toDB($pName, true),
|
||||
'plugin_version' => $tp->toDB($plug_info['@attributes']['version'], true),
|
||||
'plugin_path' => $tp->toDB($plugin_path, true),
|
||||
'plugin_installflag' => $_installed,
|
||||
'plugin_addons' => $eplug_addons,
|
||||
'plugin_category' => $this->manage_category($plug_info['category'])
|
||||
);
|
||||
|
||||
// if (e107::getDb()->db_Insert("plugin", "0, '".$tp->toDB($pName, true)."', '".$tp->toDB($plug_info['@attributes']['version'], true)."', '".$tp->toDB($plugin_path, true)."',{$_installed}, '{$eplug_addons}', '".$this->manage_category($plug_info['category'])."' "))
|
||||
if (e107::getDb()->insert("plugin", $pInsert))
|
||||
{
|
||||
$mes->addDebug("Added <b>".$tp->toHTML($pName,false,"defs")."</b> to the plugin table.");
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user