Describe the bug
Opening the organizer settings page (/manage/organizer/{id}/settings) triggers GET /api/events/undefined, which returns a 500. React Query retries it three times, so each page view logs 4 errors:
production.ERROR: HiEvents\Http\Actions\Events\GetEventAction::__invoke(): Argument #1 ($eventId) must be of type int, string given
Functionally nothing breaks, but it fills the logs and error tracking.
Cause
frontend/src/components/common/EmailTemplateSettings/EmailTemplateSettingsBase.tsx:83:
const eventQuery = useGetEvent(contextType === 'event' ? contextId : undefined);
In the organizer context eventId is undefined, but frontend/src/queries/useGetEvent.ts has no enabled guard, so the request is sent anyway:
export const useGetEvent = (eventId: IdParam) => {
return useQuery<Event, AxiosError>({
queryKey: [GET_EVENT_QUERY_KEY, eventId],
queryFn: async () => { ... },
});
};
Suggested fix
Add enabled: !!eventId to useGetEvent. Optionally, the backend could return 404 instead of 500 for a non-numeric event_id (route constraint whereNumber('event_id')).
To Reproduce
- Open
/manage/organizer/{id}/settings.
- Watch the network tab or
storage/logs/laravel.log: 4× GET /api/events/undefined → 500.
Hi.Events Version and platform
- Version: v2.0.0-rc.1 (
daveearley/hi.events-all-in-one:v2.0.0-rc.1)
- Platform: self-hosted Docker Compose, PostgreSQL 17
Describe the bug
Opening the organizer settings page (
/manage/organizer/{id}/settings) triggersGET /api/events/undefined, which returns a 500. React Query retries it three times, so each page view logs 4 errors:Functionally nothing breaks, but it fills the logs and error tracking.
Cause
frontend/src/components/common/EmailTemplateSettings/EmailTemplateSettingsBase.tsx:83:In the organizer context
eventIdisundefined, butfrontend/src/queries/useGetEvent.tshas noenabledguard, so the request is sent anyway:Suggested fix
Add
enabled: !!eventIdtouseGetEvent. Optionally, the backend could return 404 instead of 500 for a non-numericevent_id(route constraintwhereNumber('event_id')).To Reproduce
/manage/organizer/{id}/settings.storage/logs/laravel.log: 4×GET /api/events/undefined→ 500.Hi.Events Version and platform
daveearley/hi.events-all-in-one:v2.0.0-rc.1)