aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2025-06-26 22:08:27 +0200
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2025-06-27 09:29:13 +0200
commitc66efac87d87247e6879d3d65d2d6c2448f5f914 (patch)
tree6a34f51ba0f75fc2d3f4e1710e54be5976a95a6f /lib
parente62fef928039e1745a009c4e9830697b833c73cf (diff)
check core plugin activations when calculating score, fixes #5674
Closes #5674 Merge request studip/studip!4300
Diffstat (limited to 'lib')
-rw-r--r--lib/classes/Score.class.php32
1 files changed, 19 insertions, 13 deletions
diff --git a/lib/classes/Score.class.php b/lib/classes/Score.class.php
index 7b28134..3fff7ab 100644
--- a/lib/classes/Score.class.php
+++ b/lib/classes/Score.class.php
@@ -184,16 +184,9 @@ class Score
$tables[] = ['table' => 'user_info'];
$tables[] = ['table' => 'comments'];
$tables[] = ['table' => 'file_refs'];
- $tables[] = ['table' => 'forum_entries'];
$tables[] = ['table' => 'news'];
$tables[] = ['table' => 'seminar_user'];
$tables[] = [
- 'table' => 'blubber_threads'
- ];
- $tables[] = [
- 'table' => 'blubber_comments'
- ];
- $tables[] = [
'table' => 'kategorien',
'user_id_column' => 'range_id',
];
@@ -201,21 +194,34 @@ class Score
'table' => 'message',
'user_id_column' => 'autor_id'
];
+
$tables[] = ['table' => 'questionnaires'];
$tables[] = [
'table' => 'questionnaire_answers',
'date_column' => 'chdate',
];
$tables[] = ['table' => 'questionnaire_anonymous_answers'];
- $tables[] = [
- 'table' => 'wiki_pages',
- 'date_column' => 'chdate'
- ];
- $tables[] = ['table' => 'wiki_versions'];
+
+ if (PluginEngine::getPlugin(CoreForum::class)->isEnabled()) {
+ $tables[] = ['table' => 'forum_entries'];
+ }
+
+ if (PluginEngine::getPlugin(Blubber::class)->isEnabled()) {
+ $tables[] = ['table' => 'blubber_threads'];
+ $tables[] = ['table' => 'blubber_comments'];
+ }
+
+ if (PluginEngine::getPlugin(CoreWiki::class)->isEnabled()) {
+ $tables[] = [
+ 'table' => 'wiki_pages',
+ 'date_column' => 'chdate'
+ ];
+ $tables[] = ['table' => 'wiki_versions'];
+ }
foreach (PluginManager::getInstance()->getPlugins('ScorePlugin') as $plugin) {
foreach ((array) $plugin->getPluginActivityTables() as $table) {
- if ($table['table']) {
+ if (!empty($table['table'])) {
$tables[] = $table;
}
}