Skip to content

Commit

Permalink
fix activation to not remove config
Browse files Browse the repository at this point in the history
update version
  • Loading branch information
Soldras committed Feb 29, 2016
1 parent 7316cfc commit 37c4c70
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Config/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<descriptive locale="en_US">
<title>Keyword</title>
</descriptive>
<version>2.4.6</version>
<version>2.4.7</version>
<author>
<name>Michaël Espeche</name>
<email>mespeche@openstudio.fr</email>
Expand Down
21 changes: 19 additions & 2 deletions Keyword.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@

namespace Keyword;

use Keyword\Model\CategoryAssociatedKeywordQuery;
use Keyword\Model\FolderAssociatedKeywordQuery;
use Keyword\Model\ContentAssociatedKeywordQuery;
use Keyword\Model\KeywordGroupQuery;
use Keyword\Model\KeywordQuery;
use Keyword\Model\ProductAssociatedKeywordQuery;
use Propel\Runtime\Connection\ConnectionInterface;
use Thelia\Install\Database;
use Thelia\Module\BaseModule;
Expand All @@ -31,7 +37,18 @@ class Keyword extends BaseModule
{
public function postActivation(ConnectionInterface $con = null)
{
$database = new Database($con->getWrappedConnection());
$database->insertSql(null, array(THELIA_ROOT . '/local/modules/Keyword/Config/thelia.sql'));

try {
CategoryAssociatedKeywordQuery::create()->findOne();
ContentAssociatedKeywordQuery::create()->findOne();
FolderAssociatedKeywordQuery::create()->findOne();
ProductAssociatedKeywordQuery::create()->findOne();
KeywordQuery::create()->findOne();
KeywordGroupQuery::create()->findOne();
} catch (\Exception $e) {
$database = new Database($con);
$database->insertSql(null, [__DIR__ . "/Config/thelia.sql"]);
}

}
}

0 comments on commit 37c4c70

Please sign in to comment.