Skip to content

Commit

Permalink
https://github.com/FriendsOfREDAXO/iwcc/issues/22
Browse files Browse the repository at this point in the history
  • Loading branch information
Ingo Winter committed Nov 18, 2019
1 parent 41a7a3c commit ca8b330
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
6 changes: 6 additions & 0 deletions boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,9 @@
rex_extension::register('REX_FORM_SAVED', 'iwcc_cache::write');
rex_extension::register('CLANG_ADDED', 'iwcc_clang::clangAdded');
rex_extension::register('CLANG_DELETED', 'iwcc_clang::clangDeleted');

if (rex_be_controller::getCurrentPagePart(1) == 'iwcc' && $this->getConfig('justInstalled'))
{
$this->setConfig('justInstalled', false);
iwcc_clang::addonJustInstalled();
}
7 changes: 2 additions & 5 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
->setPrimaryKey('pid')
->ensure();


if (!$this->hasConfig()) {
rex_sql_util::importDump(rex_addon::get('iwcc')->getPath('_install.sql'));
iwcc_clang::addonJustInstalled();
$this->setConfig('config', []);
if ($this->getConfig('justInstalled', -1) === -1) {
$this->setConfig('justInstalled', true);
}
5 changes: 3 additions & 2 deletions lib/iwcc_clang.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,12 @@ private static function addClang($clangId)
foreach (iwcc_config::getTables(1) as $table)
{
$firstLang = rex_sql::factory();
$firstLang->setQuery('SELECT * FROM ' . $table . ' WHERE clang_id=?', [rex_clang::getStartId()]);
$firstLang->setTable($table);
$firstLang->setWhere('clang_id='.rex_clang::getStartId());
$firstLang->select();
$fields = $firstLang->getFieldnames();

$newLang = rex_sql::factory();
$newLang->setDebug(false);
foreach ($firstLang as $firstLangEntry)
{
$newLang->setTable($table);
Expand Down
2 changes: 1 addition & 1 deletion package.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package: iwcc
version: '1.0.3'
version: '1.0.4'
author: 'Friends Of REDAXO'
supportpage: https://redaxo.org/support/community/#slack

Expand Down
2 changes: 1 addition & 1 deletion uninstall.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
$this->removeConfig('config');
rex_config::remove('iwcc', 'config');
rex_sql_table::get(rex::getTable('iwcc_cookiegroup'))->drop();
rex_sql_table::get(rex::getTable('iwcc_cookie'))->drop();
rex_sql_table::get(rex::getTable('iwcc_text'))->drop();
Expand Down

0 comments on commit ca8b330

Please sign in to comment.