From c19264ac916707096fe294d996a1b7fb85206b34 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 08 Mar 2026 19:55:31 +0000
Subject: [PATCH] =Furthering along the complete refactor. Added some basic setup for is_content taxonomies, including a page for an archive of the terms.
---
inc/registry/CheckCustomTables.php | 159 ++++++++++++++++++++++++++--------------------------
1 files changed, 80 insertions(+), 79 deletions(-)
diff --git a/inc/registry/CheckCustomTables.php b/inc/registry/CheckCustomTables.php
index aeccf6c..eaf4dbc 100644
--- a/inc/registry/CheckCustomTables.php
+++ b/inc/registry/CheckCustomTables.php
@@ -6,6 +6,7 @@
}
use Exception;
+use JVBase\registrar\Registrar;
class CheckCustomTables
{
@@ -35,7 +36,7 @@
//Fetch the constants manually, in case they're not defined yet?
$this->JVB_SITE = apply_filters('jvb_site', []);
$this->JVB_MEMBERSHIP = apply_filters('jvb_membership', []);
- $this->JVB_CONTENT = apply_filters('jvb_content', []);
+ $this->JVB_CONTENT = apply_filters('jvb_content', []);
$this->JVB_TAXONOMY = apply_filters('jvb_taxonomy', []);
$this->JVB_USER = apply_filters('jvb_user', []);
@@ -130,13 +131,13 @@
error_log("JVB: Error in notification section: " . $e->getMessage());
}
- try {
+// try {
// if (array_key_exists('dashboard', $this->JVB_SITE) && $this->JVB_SITE['dashboard']) {
- $tables = array_merge($tables, $this->queueTables(), $this->errorLogTables());
+// $tables = array_merge($tables, $this->queueTables(), $this->errorLogTables());
// }
- } catch (Exception $e) {
- error_log("JVB: Error in dashboard section: " . $e->getMessage());
- }
+// } catch (Exception $e) {
+// error_log("JVB: Error in dashboard section: " . $e->getMessage());
+// }
try {
if (array_key_exists('referrals', $this->JVB_SITE) && $this->JVB_SITE['referrals']) {
@@ -440,78 +441,78 @@
* Table Definitions
*****************************************************/
- protected function queueTables():array
- {
-
- return [
- '_operation_queue' => "(
- `id` VARCHAR(64) NOT NULL,
- `type` varchar(50) NOT NULL,
- `user_id` {$this->userIDType} NOT NULL,
-
- `request_data` JSON NOT NULL CHECK (JSON_VALID(request_data)),
-
- `total_items` int(11) NOT NULL DEFAULT 1,
- `processed_items` int(11) DEFAULT 0,
- `failed_items` JSON,
-
- `priority` ENUM('high', 'normal', 'low') DEFAULT 'normal',
- `state` enum('pending', 'scheduled', 'processing', 'completed') DEFAULT 'pending',
- `outcome` enum('pending', 'success', 'partial', 'merged', 'failed', 'failed_permanent') DEFAULT 'pending',
-
- `retries` int(11) DEFAULT 0,
- `last_error_hash` CHAR(32) DEFAULT NULL,
- `error_message` text,
-
- `scheduled_at` datetime DEFAULT NULL,
- `started_at` datetime DEFAULT CURRENT_TIMESTAMP,
- `completed_at` datetime DEFAULT NULL,
-
- `metadata` JSON DEFAULT NULL,
- `result` JSON,
- `dependencies` JSON,
- `merged_into` VARCHAR(64) DEFAULT NULL,
-
- `user_dismissed` tinyint(1) DEFAULT 0,
- `created_at` DATETIME DEFAULT CURRENT_TIMESTAMP,
- `updated_at` DATETIME DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`id`),
- KEY `idx_run_queue` (state, priority, scheduled_at),
- KEY `idx_user_ops` (user_id, state),
- KEY `idx_user_type_pending` (user_id, type, state),
- KEY `idx_completed_at` (completed_at),
- KEY `idx_processing_stuck` (`state`, `started_at`)
- )",
-
- 'stats__operation_queue' => "(
- `id` bigint unsigned AUTO_INCREMENT,
- `date` date NOT NULL,
- `type` varchar(50) NOT NULL,
-
- `total_operations` int NOT NULL DEFAULT 0,
- `successful_operations` int NOT NULL DEFAULT 0,
- `partial_operations` int NOT NULL DEFAULT 0,
- `failed_operations` int NOT NULL DEFAULT 0,
- `failed_permanent_operations` int NOT NULL DEFAULT 0,
-
- `total_items_processed` int NOT NULL DEFAULT 0,
-
- `average_duration` float DEFAULT NULL,
- `max_duration` int DEFAULT NULL,
-
- `peak_queue_size` int NOT NULL DEFAULT 0,
-
- `peak_memory_usage` int DEFAULT NULL,
- `peak_cpu_usage` float DEFAULT NULL,
-
- `created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`id`),
- UNIQUE KEY (date, type),
- KEY `date_idx` (date),
- KEY `type_idx` (type)
- )"
- ];
- }
+// protected function queueTables():array
+// {
+//
+// return [
+// '_operation_queue' => "(
+// `id` VARCHAR(64) NOT NULL,
+// `type` varchar(50) NOT NULL,
+// `user_id` {$this->userIDType} NOT NULL,
+//
+// `request_data` JSON NOT NULL CHECK (JSON_VALID(request_data)),
+//
+// `total_items` int(11) NOT NULL DEFAULT 1,
+// `processed_items` int(11) DEFAULT 0,
+// `failed_items` JSON,
+//
+// `priority` ENUM('high', 'normal', 'low') DEFAULT 'normal',
+// `state` enum('pending', 'scheduled', 'processing', 'completed') DEFAULT 'pending',
+// `outcome` enum('pending', 'success', 'partial', 'merged', 'failed', 'failed_permanent') DEFAULT 'pending',
+//
+// `retries` int(11) DEFAULT 0,
+// `last_error_hash` CHAR(32) DEFAULT NULL,
+// `error_message` text,
+//
+// `scheduled_at` datetime DEFAULT NULL,
+// `started_at` datetime DEFAULT CURRENT_TIMESTAMP,
+// `completed_at` datetime DEFAULT NULL,
+//
+// `metadata` JSON DEFAULT NULL,
+// `result` JSON,
+// `dependencies` JSON,
+// `merged_into` VARCHAR(64) DEFAULT NULL,
+//
+// `user_dismissed` tinyint(1) DEFAULT 0,
+// `created_at` DATETIME DEFAULT CURRENT_TIMESTAMP,
+// `updated_at` DATETIME DEFAULT CURRENT_TIMESTAMP,
+// PRIMARY KEY (`id`),
+// KEY `idx_run_queue` (state, priority, scheduled_at),
+// KEY `idx_user_ops` (user_id, state),
+// KEY `idx_user_type_pending` (user_id, type, state),
+// KEY `idx_completed_at` (completed_at),
+// KEY `idx_processing_stuck` (`state`, `started_at`)
+// )",
+//
+// 'stats__operation_queue' => "(
+// `id` bigint unsigned AUTO_INCREMENT,
+// `date` date NOT NULL,
+// `type` varchar(50) NOT NULL,
+//
+// `total_operations` int NOT NULL DEFAULT 0,
+// `successful_operations` int NOT NULL DEFAULT 0,
+// `partial_operations` int NOT NULL DEFAULT 0,
+// `failed_operations` int NOT NULL DEFAULT 0,
+// `failed_permanent_operations` int NOT NULL DEFAULT 0,
+//
+// `total_items_processed` int NOT NULL DEFAULT 0,
+//
+// `average_duration` float DEFAULT NULL,
+// `max_duration` int DEFAULT NULL,
+//
+// `peak_queue_size` int NOT NULL DEFAULT 0,
+//
+// `peak_memory_usage` int DEFAULT NULL,
+// `peak_cpu_usage` float DEFAULT NULL,
+//
+// `created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
+// PRIMARY KEY (`id`),
+// UNIQUE KEY (date, type),
+// KEY `date_idx` (date),
+// KEY `type_idx` (type)
+// )"
+// ];
+// }
protected function errorLogTables():array
{
@@ -1519,7 +1520,7 @@
}
try {
- $contentFields = jvbGetFields($type);
+ $contentFields = Registrar::getFieldsFor($type);
if (!$contentFields || empty($contentFields)) {
return;
--
Gitblit v1.10.0