From 0be073de032843105f157ce91f3d4e24f0857a1e Mon Sep 17 00:00:00 2001 From: Andreas Kristiansen <6977712+AndreasK79@users.noreply.github.com> Date: Sat, 19 Jul 2025 08:59:14 +0200 Subject: [PATCH] Fix unknown slugs in the widget --- application/controllers/Widgets.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/application/controllers/Widgets.php b/application/controllers/Widgets.php index a97a91ee0..87663d2c5 100644 --- a/application/controllers/Widgets.php +++ b/application/controllers/Widgets.php @@ -83,13 +83,14 @@ class Widgets extends CI_Controller { $this->load->model('oqrs_model'); $data['slug'] = $this->security->xss_clean($slug); $this->load->model('publicsearch'); - $data['userid'] = $this->publicsearch->get_userid_for_slug($data['slug']); - $stations = $this->oqrs_model->get_oqrs_stations($data['userid']); + $this->load->model('stationsetup_model'); - if ($stations->result() === NULL) { + $logbook_id = $this->stationsetup_model->public_slug_exists_logbook_id($data['slug']); + if ($logbook_id == false) { show_404(__("No stations found that are using Wavelog OQRS.")); return; - } + } + $data['userid'] = $this->publicsearch->get_userid_for_slug($data['slug']); if ($data['slug'] != null) { $data['logo_url'] = base_url() . 'index.php/visitor/' . $data['slug'];