diff options
Diffstat (limited to 'plugins')
20 files changed, 321 insertions, 15 deletions
diff --git a/plugins/CoreUpdater/Commands/ConvertToUtf8mb4.php b/plugins/CoreUpdater/Commands/ConvertToUtf8mb4.php new file mode 100644 index 0000000000..141b71470c --- /dev/null +++ b/plugins/CoreUpdater/Commands/ConvertToUtf8mb4.php @@ -0,0 +1,141 @@ +<?php +/** + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + * + */ +namespace Piwik\Plugins\CoreUpdater\Commands; + +use Piwik\Config; +use Piwik\Db; +use Piwik\DbHelper; +use Piwik\Piwik; +use Piwik\Plugin\ConsoleCommand; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; + +/** + * @package CoreUpdater + */ +class ConvertToUtf8mb4 extends ConsoleCommand +{ + protected function configure() + { + $this->setName('core:convert-to-utf8mb4'); + + $this->setDescription('Converts the database to utf8mb4'); + + $this->addOption('show', null, InputOption::VALUE_NONE, Piwik::translate('Show all commands / queries only.')); + $this->addOption('yes', null, InputOption::VALUE_NONE, Piwik::translate('CoreUpdater_ConsoleParameterDescription')); + $this->addOption('keep-tracking', null, InputOption::VALUE_NONE, 'Do not disable tracking while conversion is running'); + } + + public function isEnabled() + { + $dbSettings = new Db\Settings(); + $charset = $dbSettings->getUsedCharset(); + + return $charset !== 'utf8mb4'; + } + + /** + * Execute command like: ./console core:convert-to-utf8mb4 --yes + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + $yes = $input->getOption('yes'); + $keepTracking = $input->getOption('keep-tracking'); + $show = $input->getOption('show'); + + $queries = DbHelper::getUtf8mb4ConversionQueries(); + + if ($show) { + $this->showCommands($queries, $keepTracking, $output); + return; + } + + $output->writeln("This command will convert all Matomo database tables to utf8mb4.\n"); + + if (DbHelper::getDefaultCharset() !== 'utf8mb4') { + $this->writeSuccessMessage($output, array('Your database does not support utf8mb4')); + return; + } + + if (!$keepTracking) { + $output->writeln("Tracking will be disabled during this process.\n"); + } + + $output->writeln('If you want to see what this command is going to do use the --show option.'); + + if (!$yes) { + $yes = $this->askForUpdateConfirmation($input, $output); + } + + if ($yes) { + + if (!$keepTracking) { + $output->writeln("\n" . Piwik::translate('Disabling Matomo Tracking')); + $config = Config::getInstance(); + $config->Tracker['record_statistics'] = '0'; + $config->forceSave(); + } + + $output->writeln("\n" . Piwik::translate('CoreUpdater_ConsoleStartingDbUpgrade')); + + foreach ($queries as $query) { + $output->write("\n" . 'Executing ' . $query . '... '); + Db::get()->exec($query); + $output->write(' done.'); + } + + $output->writeln("\n" . 'Updating used database charset in config.ini.php.'); + $config = Config::getInstance(); + $config->database['charset'] = 'utf8mb4'; + + if (!$keepTracking) { + $output->writeln("\n" . Piwik::translate('Enabling Matomo Tracking')); + $config->Tracker['record_statistics'] = '1'; + } + + $config->forceSave(); + + $this->writeSuccessMessage($output, array('Conversion to utf8mb4 successful.')); + + } else { + $this->writeSuccessMessage($output, array('Database conversion skipped.')); + } + } + + protected function showCommands($queries, $keepTracking, OutputInterface $output) + { + $output->writeln("To manually convert all Matomo database tables to utf8mb4 follow these steps."); + if (!$keepTracking) { + $output->writeln(''); + $output->writeln('** Disable Matomo Tracking with this command: **'); + $output->writeln('./console config:set --section=Tracker --key=record_statistics --value=0'); + } + $output->writeln(''); + $output->writeln('** Execute the following database queries: **'); + $output->writeln(implode("\n", $queries)); + $output->writeln(''); + $output->writeln('** Change configured database charset to utf8mb4 with this command: **'); + $output->writeln('./console config:set --section=database --key=charset --value=utf8mb4'); + if (!$keepTracking) { + $output->writeln(''); + $output->writeln('** Enable Matomo Tracking again with this command: **'); + $output->writeln('./console config:set --section=Tracker --key=record_statistics --value=1'); + } + } + + private function askForUpdateConfirmation(InputInterface $input, OutputInterface $output) + { + $helper = $this->getHelper('question'); + $question = new ConfirmationQuestion('<comment>Execute updates? (y/N) </comment>', false); + + return $helper->ask($input, $output, $question); + } +} diff --git a/plugins/CoreUpdater/SystemSettings.php b/plugins/CoreUpdater/SystemSettings.php index 8bf13a03b9..e8de1fb493 100644 --- a/plugins/CoreUpdater/SystemSettings.php +++ b/plugins/CoreUpdater/SystemSettings.php @@ -8,6 +8,8 @@ namespace Piwik\Plugins\CoreUpdater; +use Piwik\Db\Settings; +use Piwik\DbHelper; use Piwik\Piwik; use Piwik\Plugin\ReleaseChannels; use Piwik\Plugins\CoreAdminHome\Controller as CoreAdminController; @@ -31,6 +33,9 @@ class SystemSettings extends \Piwik\Settings\Plugin\SystemSettings /** @var Setting */ public $sendPluginUpdateEmail; + /** @var Setting */ + public $updateToUtf8mb4; + /** * @var ReleaseChannels */ @@ -54,6 +59,12 @@ class SystemSettings extends \Piwik\Settings\Plugin\SystemSettings $isWritable = $isWritable && PluginUpdateCommunication::canBeEnabled(); $this->sendPluginUpdateEmail = $this->createSendPluginUpdateEmail(); $this->sendPluginUpdateEmail->setIsWritableByCurrentUser($isWritable); + + $isWritable = Piwik::hasUserSuperUserAccess() && CoreAdminController::isGeneralSettingsAdminEnabled(); + $dbSettings = new Settings(); + if ($isWritable && $dbSettings->getUsedCharset() !== 'utf8mb4' && DbHelper::getDefaultCharset() === 'utf8mb4') { + $this->updateToUtf8mb4 = $this->createUpdateToUtf8mb4(); + } } private function createReleaseChannel() @@ -104,4 +115,19 @@ class SystemSettings extends \Piwik\Settings\Plugin\SystemSettings }); } + private function createUpdateToUtf8mb4() + { + return $this->makeSetting('update_to_utf8mb4', $default = false, FieldConfig::TYPE_BOOL, function (FieldConfig $field) { + $field->introduction = Piwik::translate('CoreUpdater_ConvertToUtf8mb4'); + $field->title = Piwik::translate('CoreUpdater_TriggerDatabaseConversion'); + $field->uiControl = FieldConfig::UI_CONTROL_CHECKBOX; + $field->inlineHelp = Piwik::translate('CoreUpdater_Utf8mb4ConversionHelp', [ + '�', + '<code>' . PIWIK_INCLUDE_PATH . '/console core:convert-to-utf8mb4</code>', + '<a href="https://matomo.org/faq/how-to-update/how-to-convert-the-database-to-utf8mb4-charset/" rel="noreferrer noopener" target="_blank">', + '</a>' + ]); + }); + } + } diff --git a/plugins/CoreUpdater/Tasks.php b/plugins/CoreUpdater/Tasks.php index 7998a83925..f3ecae955d 100644 --- a/plugins/CoreUpdater/Tasks.php +++ b/plugins/CoreUpdater/Tasks.php @@ -8,11 +8,23 @@ */ namespace Piwik\Plugins\CoreUpdater; +use Piwik\Config; +use Piwik\Container\StaticContainer; +use Piwik\Db; +use Piwik\DbHelper; + class Tasks extends \Piwik\Plugin\Tasks { public function schedule() { $this->daily('sendNotificationIfUpdateAvailable', null, self::LOWEST_PRIORITY); + + $dbSettings = new \Piwik\Db\Settings(); + $settings = StaticContainer::get('Piwik\Plugins\CoreUpdater\SystemSettings'); + + if ($dbSettings->getUsedCharset() !== 'utf8mb4' && DbHelper::getDefaultCharset() === 'utf8mb4' && $settings->updateToUtf8mb4->getValue()) { + $this->daily('convertToUtf8mb4', null, self::HIGHEST_PRIORITY); + } } public function sendNotificationIfUpdateAvailable() @@ -22,4 +34,20 @@ class Tasks extends \Piwik\Plugin\Tasks $coreUpdateCommunication->sendNotificationIfUpdateAvailable(); } } + + public function convertToUtf8mb4() + { + $queries = DbHelper::getUtf8mb4ConversionQueries(); + + foreach ($queries as $query) { + Db::get()->exec($query); + } + + $config = Config::getInstance(); + $config->database['charset'] = 'utf8mb4'; + $config->forceSave(); + + $settings = StaticContainer::get('Piwik\Plugins\CoreUpdater\SystemSettings'); + $settings->updateToUtf8mb4->setValue(false); + } }
\ No newline at end of file diff --git a/plugins/CoreUpdater/lang/en.json b/plugins/CoreUpdater/lang/en.json index bc703116b8..728706f1c4 100644 --- a/plugins/CoreUpdater/lang/en.json +++ b/plugins/CoreUpdater/lang/en.json @@ -91,6 +91,9 @@ "YouMustDownloadPackageOrFixPermissions": "Matomo is unable to overwrite your current installation. You can either fix the directory\/file permissions, or download the package and install version %s manually:", "YourDatabaseIsOutOfDate": "Your Matomo database is out-of-date, and must be upgraded before you can continue.", "ViewVersionChangelog": "View the changelog for this version:", - "ReceiveEmailBecauseIsSuperUser": "You receive this email because you are a Super User on the Matomo at: %s" + "ReceiveEmailBecauseIsSuperUser": "You receive this email because you are a Super User on the Matomo at: %s", + "ConvertToUtf8mb4": "Convert database to UTF8mb4 charset", + "TriggerDatabaseConversion": "Trigger database conversion in background", + "Utf8mb4ConversionHelp": "Your database is currently not using utf8mb4 charset. This makes it impossible to store 4-byte characters, such as emojis, less common characters of asian languages, various historic scripts or mathematical symbols. Those are currently replaced with %1$s.<br /><br />Your database supports the utf8mb4 charset and it would be possible to convert it.<br /><br />If you are able to run console commands we recommend using this command: %2$s<br /><br />Alternatively you can enable the conversion here. It will then be triggered automatically as a scheduled task in the background.<br /><br />Attention: Converting the database might take up to a couple of hours depending on the database size. As tracking might not work during this process, we do not recommend to use the trigger for bigger instances.<br /><br />You can find more information about this topic in this %3$sFAQ%4$s." } } diff --git a/plugins/CustomAlerts b/plugins/CustomAlerts -Subproject 63b7cdd5cb374cc40e7fb0857d215f66a48d8bc +Subproject 8e17d3977e2c9443ea0b51f6ec40e90f89fa56f diff --git a/plugins/CustomDimensions b/plugins/CustomDimensions -Subproject aeb7231db7746aa77e94c2f0b0bc2633fa50bc5 +Subproject 10665789dc16cf7bef9513891df4c6fd1353352 diff --git a/plugins/DBStats/tests/UI/expected-screenshots/DBStats_admin_page.png b/plugins/DBStats/tests/UI/expected-screenshots/DBStats_admin_page.png index 0775f88f58..728709e0bc 100644 --- a/plugins/DBStats/tests/UI/expected-screenshots/DBStats_admin_page.png +++ b/plugins/DBStats/tests/UI/expected-screenshots/DBStats_admin_page.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f91af708ab6062666dcfe4486b507ab61df96b4d799e32f28df3afe4c77ec10d -size 225637 +oid sha256:7ba1a11dba92cd190560f4c556f5dcc3de90588346db5c45a6e98d954b15b69e +size 228111 diff --git a/plugins/Dashboard/Dashboard.php b/plugins/Dashboard/Dashboard.php index 8eeec660c6..652bad1b4f 100644 --- a/plugins/Dashboard/Dashboard.php +++ b/plugins/Dashboard/Dashboard.php @@ -32,10 +32,21 @@ class Dashboard extends \Piwik\Plugin 'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys', 'Widget.addWidgetConfigs' => 'addWidgetConfigs', 'Category.addSubcategories' => 'addSubcategories', - 'Widgetize.shouldEmbedIframeEmpty' => 'shouldEmbedIframeEmpty' + 'Widgetize.shouldEmbedIframeEmpty' => 'shouldEmbedIframeEmpty', + 'Db.getTablesInstalled' => 'getTablesInstalled' ); } + /** + * Register the new tables, so Matomo knows about them. + * + * @param array $allTablesInstalled + */ + public function getTablesInstalled(&$allTablesInstalled) + { + $allTablesInstalled[] = Common::prefixTable('user_dashboard'); + } + public function shouldEmbedIframeEmpty(&$shouldEmbedEmpty, $controllerName, $actionName) { if ($controllerName == 'Dashboard' && $actionName == 'index') { diff --git a/plugins/Diagnostics/Diagnostic/DatabaseAbilitiesCheck.php b/plugins/Diagnostics/Diagnostic/DatabaseAbilitiesCheck.php index f867bcce67..563c904bcc 100644 --- a/plugins/Diagnostics/Diagnostic/DatabaseAbilitiesCheck.php +++ b/plugins/Diagnostics/Diagnostic/DatabaseAbilitiesCheck.php @@ -10,6 +10,7 @@ namespace Piwik\Plugins\Diagnostics\Diagnostic; use Piwik\Common; use Piwik\Config; use Piwik\Db; +use Piwik\DbHelper; use Piwik\Translation\Translator; /** @@ -37,6 +38,8 @@ class DatabaseAbilitiesCheck implements Diagnostic $result = new DiagnosticResult($this->translator->translate('Installation_DatabaseAbilities')); + $result->addItem($this->checkUtf8mb4Charset()); + if (Config::getInstance()->General['enable_load_data_infile']) { $result->addItem($this->checkLoadDataInfile()); } @@ -47,6 +50,34 @@ class DatabaseAbilitiesCheck implements Diagnostic return [$result]; } + protected function checkUtf8mb4Charset() + { + $dbSettings = new Db\Settings(); + $charset = $dbSettings->getUsedCharset(); + + if (DbHelper::getDefaultCharset() === 'utf8mb4' && $charset === 'utf8mb4') { + return new DiagnosticResultItem(DiagnosticResult::STATUS_OK, 'UTF8mb4 charset'); + } + + if (DbHelper::getDefaultCharset() === 'utf8mb4') { + return new DiagnosticResultItem( + DiagnosticResult::STATUS_WARNING, 'UTF8mb4 charset<br/><br/>' . + $this->translator->translate('Diagnostics_DatabaseUtf8mb4CharsetAvailableButNotUsed', '<code>' . PIWIK_INCLUDE_PATH . '/console core:convert-to-utf8mb4</code>') . + '<br/><br/>' . + $this->translator->translate('Diagnostics_DatabaseUtf8Requirement', ['�', '<a href="https://matomo.org/faq/how-to-update/how-to-convert-the-database-to-utf8mb4-charset/" rel="noreferrer noopener" target="_blank">', '</a>']) . + '<br/>' + ); + } + + return new DiagnosticResultItem( + DiagnosticResult::STATUS_WARNING, 'UTF8mb4 charset<br/><br/>' . + $this->translator->translate('Diagnostics_DatabaseUtf8mb4CharsetRecommended') . + '<br/><br/>' . + $this->translator->translate('Diagnostics_DatabaseUtf8Requirement', ['�', '<a href="https://matomo.org/faq/how-to-update/how-to-convert-the-database-to-utf8mb4-charset/" rel="noreferrer noopener" target="_blank">', '</a>']) . + '<br/>' + ); + } + protected function checkLoadDataInfile() { $optionTable = Common::prefixTable('option'); diff --git a/plugins/Diagnostics/lang/en.json b/plugins/Diagnostics/lang/en.json index 741126d70b..cf7f935f23 100644 --- a/plugins/Diagnostics/lang/en.json +++ b/plugins/Diagnostics/lang/en.json @@ -9,6 +9,9 @@ "HideUnchanged": "If you want to see only changed values you can %1$shide all unchanged values%2$s.", "Sections": "Sections", "DatabaseReaderConnection": "Database Reader Connection", + "DatabaseUtf8Requirement": "This is required to be able to store 4-byte UTF8 characters. Unless utf8mb4 is available special characters, such as emojis, less common characters of asian languages, various historic scripts or mathematical symbols will be replaced with %1$s. You can read more details about this topic in %2$sthis FAQ%3$s.", + "DatabaseUtf8mb4CharsetRecommended": "Your database doesn't support utf8mb4 charset yet.", + "DatabaseUtf8mb4CharsetAvailableButNotUsed": "Your database supports utf8mb4 charset, but your database tables have not been converted yet. You can do this by executing the command %1$s or activating the automatic conversion in General Settings.", "CronArchivingLastRunCheck": "Last Successful Archiving Completion", "CronArchivingHasNotRun": "Archiving has not yet run successfully.", "CronArchivingHasNotRunInAWhile": "Archiving last ran successfully on %1$s which is %2$s ago.", diff --git a/plugins/Diagnostics/tests/UI/expected-screenshots/Diagnostics_page.png b/plugins/Diagnostics/tests/UI/expected-screenshots/Diagnostics_page.png index 28a561a3e6..eb8d9abcdd 100644 --- a/plugins/Diagnostics/tests/UI/expected-screenshots/Diagnostics_page.png +++ b/plugins/Diagnostics/tests/UI/expected-screenshots/Diagnostics_page.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d1982392882b95083955e07a3b2a49ae09f877db360e7e120f157221277eeaf5 -size 204436 +oid sha256:16f6eb7a77e36b275e3293d82b29a7c304587ac1dbf0064f641b2aadaa0915f8 +size 206667 diff --git a/plugins/ExampleLogTables/Dao/CustomUserLog.php b/plugins/ExampleLogTables/Dao/CustomUserLog.php index 50f3016301..ecdfd96f6f 100644 --- a/plugins/ExampleLogTables/Dao/CustomUserLog.php +++ b/plugins/ExampleLogTables/Dao/CustomUserLog.php @@ -25,7 +25,7 @@ class CustomUserLog public function install() { DbHelper::createTable($this->table, " - `user_id` VARCHAR(200) NOT NULL, + `user_id` VARCHAR(191) NOT NULL, `gender` VARCHAR(30) NOT NULL, `group` VARCHAR(30) NOT NULL, PRIMARY KEY (user_id)"); diff --git a/plugins/ExampleLogTables/ExampleLogTables.php b/plugins/ExampleLogTables/ExampleLogTables.php index caf83d594b..ed7ada493f 100644 --- a/plugins/ExampleLogTables/ExampleLogTables.php +++ b/plugins/ExampleLogTables/ExampleLogTables.php @@ -8,11 +8,19 @@ */ namespace Piwik\Plugins\ExampleLogTables; +use Piwik\Common; use Piwik\Plugins\ExampleLogTables\Dao\CustomUserLog; use Piwik\Plugins\ExampleLogTables\Dao\CustomGroupLog; class ExampleLogTables extends \Piwik\Plugin { + public function registerEvents() + { + return [ + 'Db.getTablesInstalled' => 'getTablesInstalled' + ]; + } + public function install() { // Install custom log table [disabled as example only] @@ -23,4 +31,15 @@ class ExampleLogTables extends \Piwik\Plugin // $userLog = new CustomGroupLog(); // $userLog->install(); } + + /** + * Register the new tables, so Matomo knows about them. + * + * @param array $allTablesInstalled + */ + public function getTablesInstalled(&$allTablesInstalled) + { + $allTablesInstalled[] = Common::prefixTable('log_group'); + $allTablesInstalled[] = Common::prefixTable('log_custom'); + } }
\ No newline at end of file diff --git a/plugins/Installation/Controller.php b/plugins/Installation/Controller.php index b7dbd5a60a..4452c914b4 100644 --- a/plugins/Installation/Controller.php +++ b/plugins/Installation/Controller.php @@ -598,9 +598,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin $config->General['installation_in_progress'] = 1; $config->database = $dbInfos; - if (!DbHelper::isDatabaseConnectionUTF8()) { - $config->database['charset'] = 'utf8'; - } + $config->database['charset'] = DbHelper::getDefaultCharset(); $config->forceSave(); diff --git a/plugins/LanguagesManager/LanguagesManager.php b/plugins/LanguagesManager/LanguagesManager.php index 71f67910ff..b73dfff640 100644 --- a/plugins/LanguagesManager/LanguagesManager.php +++ b/plugins/LanguagesManager/LanguagesManager.php @@ -39,10 +39,21 @@ class LanguagesManager extends \Piwik\Plugin 'Platform.initialized' => 'initLanguage', 'UsersManager.deleteUser' => 'deleteUserLanguage', 'Template.topBar' => 'addLanguagesManagerToOtherTopBar', - 'Template.jsGlobalVariables' => 'jsGlobalVariables' + 'Template.jsGlobalVariables' => 'jsGlobalVariables', + 'Db.getTablesInstalled' => 'getTablesInstalled' ); } + /** + * Register the new tables, so Matomo knows about them. + * + * @param array $allTablesInstalled + */ + public function getTablesInstalled(&$allTablesInstalled) + { + $allTablesInstalled[] = Common::prefixTable('user_language'); + } + public function getJsFiles(&$jsFiles) { $jsFiles[] = "plugins/LanguagesManager/angularjs/languageselector/languageselector.directive.js"; diff --git a/plugins/PrivacyManager/PrivacyManager.php b/plugins/PrivacyManager/PrivacyManager.php index b107f20189..96d659eb58 100644 --- a/plugins/PrivacyManager/PrivacyManager.php +++ b/plugins/PrivacyManager/PrivacyManager.php @@ -24,6 +24,7 @@ use Piwik\Piwik; use Piwik\Plugin; use Piwik\Plugins\Goals\Archiver; use Piwik\Plugins\Installation\FormDefaultSettings; +use Piwik\Plugins\PrivacyManager\Model\LogDataAnonymizations; use Piwik\Site; use Piwik\Tracker\Cache; use Piwik\Tracker\GoalManager; @@ -182,11 +183,22 @@ class PrivacyManager extends Plugin 'Tracker.setVisitorIp' => array($this->ipAnonymizer, 'setVisitorIpAddress'), 'Installation.defaultSettingsForm.init' => 'installationFormInit', 'Installation.defaultSettingsForm.submit' => 'installationFormSubmit', - 'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys', - 'Template.pageFooter' => 'renderPrivacyPolicyLinks', + 'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys', + 'Template.pageFooter' => 'renderPrivacyPolicyLinks', + 'Db.getTablesInstalled' => 'getTablesInstalled' ); } + /** + * Register the new tables, so Matomo knows about them. + * + * @param array $allTablesInstalled + */ + public function getTablesInstalled(&$allTablesInstalled) + { + $allTablesInstalled[] = Common::prefixTable(LogDataAnonymizations::getDbTableName()); + } + public function isTrackerPlugin() { return true; diff --git a/plugins/QueuedTracking b/plugins/QueuedTracking -Subproject 3bb2ec92d755afa276e8555fae36bf8b4ed8db0 +Subproject 154a0ca633c139408146dfa9a9996a3cb309d18 diff --git a/plugins/ScheduledReports/ScheduledReports.php b/plugins/ScheduledReports/ScheduledReports.php index a2c62b2700..05bb43ef78 100644 --- a/plugins/ScheduledReports/ScheduledReports.php +++ b/plugins/ScheduledReports/ScheduledReports.php @@ -96,9 +96,21 @@ class ScheduledReports extends \Piwik\Plugin 'SegmentEditor.update' => 'segmentUpdated', 'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys', 'Request.getRenamedModuleAndAction' => 'renameDeprecatedModuleAndAction', + 'Db.getTablesInstalled' => 'getTablesInstalled' ); } + /** + * Register the new tables, so Matomo knows about them. + * + * @param array $allTablesInstalled + */ + public function getTablesInstalled(&$allTablesInstalled) + { + $allTablesInstalled[] = Common::prefixTable('report'); + $allTablesInstalled[] = Common::prefixTable('report_subscriptions'); + } + public function renameDeprecatedModuleAndAction(&$module, &$action) { if($module == 'PDFReports') { diff --git a/plugins/SegmentEditor/SegmentEditor.php b/plugins/SegmentEditor/SegmentEditor.php index 38a49443ad..d5beb44ab2 100644 --- a/plugins/SegmentEditor/SegmentEditor.php +++ b/plugins/SegmentEditor/SegmentEditor.php @@ -48,11 +48,22 @@ class SegmentEditor extends \Piwik\Plugin 'Template.nextToCalendar' => 'getSegmentEditorHtml', 'System.addSystemSummaryItems' => 'addSystemSummaryItems', 'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys', - 'Visualization.onNoData' => 'onNoData', - 'Archive.noArchivedData' => 'onNoArchiveData', + 'Visualization.onNoData' => 'onNoData', + 'Archive.noArchivedData' => 'onNoArchiveData', + 'Db.getTablesInstalled' => 'getTablesInstalled' ); } + /** + * Register the new tables, so Matomo knows about them. + * + * @param array $allTablesInstalled + */ + public function getTablesInstalled(&$allTablesInstalled) + { + $allTablesInstalled[] = Common::prefixTable('segment'); + } + public function addSystemSummaryItems(&$systemSummary) { $storedSegments = StaticContainer::get('Piwik\Plugins\SegmentEditor\Services\StoredSegmentService'); diff --git a/plugins/TagManager b/plugins/TagManager -Subproject 2105be36d15030f632efd60d71b761f6e1a5f8f +Subproject bb8cc3b28952b6f3a7891b5b10737f603d46374 |