fix(registration): Remove hardcoded page IDs causing login redirect
Some checks are pending
HVAC Plugin CI/CD Pipeline / Security Analysis (push) Waiting to run
HVAC Plugin CI/CD Pipeline / Code Quality & Standards (push) Waiting to run
HVAC Plugin CI/CD Pipeline / Unit Tests (push) Waiting to run
HVAC Plugin CI/CD Pipeline / Integration Tests (push) Waiting to run
HVAC Plugin CI/CD Pipeline / Deploy to Staging (push) Blocked by required conditions
HVAC Plugin CI/CD Pipeline / Deploy to Production (push) Blocked by required conditions
HVAC Plugin CI/CD Pipeline / Notification (push) Blocked by required conditions
Security Monitoring & Compliance / Security Compliance Validation (push) Waiting to run
Security Monitoring & Compliance / Dependency Vulnerability Scan (push) Waiting to run
Security Monitoring & Compliance / Secrets & Credential Scan (push) Waiting to run
Security Monitoring & Compliance / WordPress Security Analysis (push) Waiting to run
Security Monitoring & Compliance / Static Code Security Analysis (push) Waiting to run
Security Monitoring & Compliance / Security Summary Report (push) Blocked by required conditions
Security Monitoring & Compliance / Security Team Notification (push) Blocked by required conditions

The registration page (ID 5334 on staging) was incorrectly matched by
HVAC_Event_Manager::isManagePage() which had is_page(5334) as a legacy
check. This caused non-logged-in users to be redirected to the login
page instead of seeing the public registration form. Removed hardcoded
page IDs from isManagePage() and isEditPage() in favor of URL/slug
detection which is environment-independent.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
ben 2026-02-20 12:42:34 -04:00
parent 4d986714b6
commit 8adc3ac8e4
2 changed files with 8 additions and 10 deletions

View file

@ -135,7 +135,7 @@ final class HVAC_Event_Manager {
// Event management (creation) page
if ($this->isManagePage()) {
$custom_template = HVAC_PLUGIN_DIR . 'templates/page-trainer-event-manage.php';
$custom_template = HVAC_PLUGIN_DIR . 'templates/page-manage-event.php';
if (file_exists($custom_template)) {
return $custom_template;
}
@ -170,8 +170,7 @@ final class HVAC_Event_Manager {
strpos($request_uri, '/trainer/event/manage') !== false ||
get_query_var('hvac_event_manage') === '1' ||
is_page('manage-event') ||
is_page('trainer-event-manage') ||
is_page(5334) // Legacy page ID
is_page('trainer-event-manage')
);
}
@ -184,7 +183,6 @@ final class HVAC_Event_Manager {
return (
strpos($request_uri, '/trainer/event/edit') !== false ||
get_query_var('hvac_event_edit') === '1' ||
is_page(6177) || // Configuration-based page ID
(is_page() && get_page_template_slug() === 'templates/page-edit-event-custom.php')
);
}