From 75a097a018a0090f5902758353c578fce4aa2a25 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sat, 23 May 2026 18:43:42 +0000
Subject: [PATCH] =CustomBlocks.php overhaul relatively complete. Also refactored the gallery in gallery.min.js and the jvbRenderGallery.
---
inc/managers/KarmaManager.php | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/inc/managers/KarmaManager.php b/inc/managers/KarmaManager.php
index 6bba6da..4aaa56e 100644
--- a/inc/managers/KarmaManager.php
+++ b/inc/managers/KarmaManager.php
@@ -122,7 +122,7 @@
protected function defineTable():bool
{
$table = CustomTable::for('karma_'.$this->key);
- [$type, $table, $column] = $this->getReferenceTable($table);
+ [$type, $referenceTable, $column] = $this->getReferenceTable($table);
if (!$type) {
error_log('[KarmaManager]::defineTable Attempted to build reference for invalid table: '.$this->references);
CustomTable::destroyInstance('karma_'.$this->key);
@@ -134,7 +134,7 @@
'item_id' => "{$type} NOT NULL",
'user_id' => "{$table->getUserIDType()} NOT NULL",
'content' => 'varchar(255) NOT NULL',
- 'vote' => "ENUM('up,'down') NOT NULL",
+ 'vote' => "ENUM('up','down') NOT NULL",
'created_at'=> 'datetime NOT NULL DEFAULT CURRENT_TIMESTAMP',
'updated_at'=> 'datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'
]);
@@ -147,9 +147,9 @@
]);
$base = BASE;
$table->setConstraints([
- "CONSTRAINT `{$base}kt_{$type}_item_id` FOREIGN KEY (`item_id`)
- REFERENCES `{$table}` (`{$column}`) ON DELETE CASCADE",
- "CONSTRAINT `{$base}kt_{$type}_user_id` FOREIGN KEY (`user_id`)
+ "CONSTRAINT `{$base}kt_{$this->key}_{$type}_item_id` FOREIGN KEY (`item_id`)
+ REFERENCES `{$referenceTable}` (`{$column}`) ON DELETE CASCADE",
+ "CONSTRAINT `{$base}kt_{$this->key}_{$type}_user_id` FOREIGN KEY (`user_id`)
REFERENCES `{$table->getUserTable()}` (`ID`) ON DELETE CASCADE"
]);
$table->defineTable();
--
Gitblit v1.10.0