fix(monitor): remove non-existent worker columns from job_run_logs query
The job_run_logs table tracks scheduled job orchestration, not individual worker jobs. Worker info (worker_id, worker_hostname) belongs on dispensary_crawl_jobs, not job_run_logs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -25,6 +25,33 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
return ['general'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get products for the SELECT2 dropdown
|
||||
*
|
||||
* @return array Associative array of product_id => product_name
|
||||
*/
|
||||
protected function get_products_for_select() {
|
||||
$options = ['' => __('-- Select a Product --', 'crawlsy-menus')];
|
||||
|
||||
$plugin = Crawlsy_Menus_Plugin::instance();
|
||||
$products = $plugin->fetch_products(['limit' => 500]);
|
||||
|
||||
if ($products && is_array($products)) {
|
||||
foreach ($products as $product) {
|
||||
$label = $product['name'];
|
||||
if (!empty($product['brand'])) {
|
||||
$label = $product['brand'] . ' - ' . $label;
|
||||
}
|
||||
if (!empty($product['category'])) {
|
||||
$label .= ' (' . $product['category'] . ')';
|
||||
}
|
||||
$options[$product['id']] = $label;
|
||||
}
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
|
||||
// Content Section
|
||||
@@ -36,13 +63,31 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
]
|
||||
);
|
||||
|
||||
// Get products for the select dropdown
|
||||
$products_options = $this->get_products_for_select();
|
||||
|
||||
$this->add_control(
|
||||
'product_id',
|
||||
[
|
||||
'label' => __('Product ID', 'crawlsy-menus'),
|
||||
'label' => __('Select Product', 'crawlsy-menus'),
|
||||
'type' => \Elementor\Controls_Manager::SELECT2,
|
||||
'options' => $products_options,
|
||||
'default' => '',
|
||||
'label_block' => true,
|
||||
'description' => __('Search and select a product to display', 'crawlsy-menus'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'product_id_manual',
|
||||
[
|
||||
'label' => __('Or Enter Product ID', 'crawlsy-menus'),
|
||||
'type' => \Elementor\Controls_Manager::NUMBER,
|
||||
'default' => '',
|
||||
'description' => __('Enter the product ID to display', 'crawlsy-menus'),
|
||||
'description' => __('Manually enter a product ID if not found in dropdown', 'crawlsy-menus'),
|
||||
'condition' => [
|
||||
'product_id' => '',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
@@ -228,13 +273,16 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
protected function render() {
|
||||
$settings = $this->get_settings_for_display();
|
||||
|
||||
if (empty($settings['product_id'])) {
|
||||
echo '<p>' . __('Please enter a product ID.', 'crawlsy-menus') . '</p>';
|
||||
// Use dropdown selection, or fall back to manual ID
|
||||
$product_id = !empty($settings['product_id']) ? $settings['product_id'] : $settings['product_id_manual'];
|
||||
|
||||
if (empty($product_id)) {
|
||||
echo '<p>' . __('Please select or enter a product ID.', 'crawlsy-menus') . '</p>';
|
||||
return;
|
||||
}
|
||||
|
||||
$plugin = Crawlsy_Menus_Plugin::instance();
|
||||
$product = $plugin->fetch_product($settings['product_id']);
|
||||
$product = $plugin->fetch_product($product_id);
|
||||
|
||||
if (!$product) {
|
||||
echo '<p>' . __('Product not found.', 'crawlsy-menus') . '</p>';
|
||||
|
||||
Reference in New Issue
Block a user