By Guest on Friday, 07 October 2016
Replies 5
Likes 1
Views 1.2K
Votes 0
On a fresh install of Joomla 3.6.2, I attempted to install JEvents 3.4 with the file jevents34_3.4.22.zip with the date of October 7, 2016. The issue that I have is that the install attempts to add a column that already exists. On line 604 of the install.php script inside of the component folder, you are getting: "SHOW INDEX" and should be using: "SHOW COLUMN".

Just giving you a heads up before others attempt to install this new version and it breaks their existing jevents by updating a component and leaving the database in an non-updated state.

Should be:


$sql = "SHOW COLUMN FROM #__jevents_filtermap";
$db->setQuery($sql);
$cols = @$db->loadObjectList("Key_name");

if (!array_key_exists("andor", $cols))
{
$sql = "ALTER TABLE #__jevents_filtermap ADD COLUMN andor tinyint(3) NOT NULL default 0";
$db->setQuery($sql);
@$db->execute();
}

if (!array_key_exists("modid", $cols))
{
$sql = "ALTER TABLE #__jevents_filtermap ADD COLUMN modid int(12) NOT NULL default 0";
$db->setQuery($sql);
@$db->execute();
}

if (!array_key_exists("name", $cols))
{
$sql = "ALTER TABLE #__jevents_filtermap ADD COLUMN name varchar(255) $rowcharset NOT NULL default '' ";
$db->setQuery($sql);
@$db->execute();
}
GRRRR!!!!

Should be:


$sql = "SHOW COLUMNS FROM #__jevents_filtermap";
$db->setQuery($sql);
$cols = @$db->loadObjectList("Key_name");

if (!array_key_exists("andor", $cols))
{
$sql = "ALTER TABLE #__jevents_filtermap ADD COLUMN andor tinyint(3) NOT NULL default 0";
$db->setQuery($sql);
@$db->execute();
}

if (!array_key_exists("modid", $cols))
{
$sql = "ALTER TABLE #__jevents_filtermap ADD COLUMN modid int(12) NOT NULL default 0";
$db->setQuery($sql);
@$db->execute();
}

if (!array_key_exists("name", $cols))
{
$sql = "ALTER TABLE #__jevents_filtermap ADD COLUMN name varchar(255) $rowcharset NOT NULL default '' ";
$db->setQuery($sql);
@$db->execute();
}
·
Friday, 07 October 2016 13:56
·
1 Likes
·
0 Votes
·
0 Comments
·
Thanks - I'll take a look right now
·
Friday, 07 October 2016 13:56
·
1 Likes
·
0 Votes
·
0 Comments
·
You're welcome!
·
Friday, 07 October 2016 13:58
·
1 Likes
·
0 Votes
·
0 Comments
·
OK. I must still be asleep....

You'll also need to change the line:


$cols = @$db->loadObjectList("Key_name");


to:


$cols = @$db->loadObjectList("Field");


But, I am sure that you would notice that better than I did. LOL
·
Friday, 07 October 2016 14:02
·
1 Likes
·
0 Votes
·
0 Comments
·
Spotted that too (but not at first) - 3.4.23 has that included (though for about 2 minutes it didn't before I updated the file).
·
Friday, 07 October 2016 14:17
·
1 Likes
·
0 Votes
·
0 Comments
·
View Full Post