{"record":{"id":"1ee6bc18574a0ec0","repo":"octobercms/october","slug":"invalid-handler-name-the-correct-handler-name-for","errorCode":null,"errorMessage":"Invalid handler name. The correct handler name format is: \"onEvent\".","messagePattern":"Invalid handler name\\. The correct handler name format is: \"onEvent\"\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"modules/backend/vuecomponents/uploader/assets/js/queue.js","lineNumber":5,"sourceCode":"import PQueue from 'p-queue';\n\nfunction uploadAjaxRequest(handler, requestData, onProgress, abortSignal) {\n    if (!handler.match(/^(?:\\w+\\:{2})?on*/) && handler !== 'mediamanager') {\n        throw new Error('Invalid handler name. The correct handler name format is: \"onEvent\".');\n    }\n\n    return new Promise((resolve, reject) => {\n        if (abortSignal?.aborted) {\n            return resolve();\n        }\n\n        const xhr = new XMLHttpRequest();\n        xhr.open('POST', window.location.href);\n\n        const token = getToken();\n        if (token) {\n            xhr.setRequestHeader('X-CSRF-TOKEN', token);\n        }\n\n        if (handler !== 'mediamanager') {\n            xhr.setRequestHeader('X-AJAX-HANDLER', handler);\n            xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');","sourceCodeStart":1,"sourceCodeEnd":23,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/vuecomponents/uploader/assets/js/queue.js#L1-L23","documentation":"Sentinel guard at the top of uploadAjaxRequest: before an XHR is opened, the handler string is matched against a regex requiring the 'onEvent' naming convention (optionally namespaced with a '::' prefix, e.g. 'Backend\\Classes\\Controller::onUpload'); the literal handler 'mediamanager' is also whitelisted. Any handler string that does not start with 'on' (after an optional namespace) fails this check, meaning the AJAX upload request was pointed at a PHP handler method that cannot exist.","triggerScenarios":"Thrown at modules/backend/vuecomponents/uploader/assets/js/queue.js:5 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename the target PHP handler method to follow the 'onEvent' convention, e.g. onUpload or onSave","If the handler lives in another class, use the fully namespaced form 'Vendor\\Plugin\\Classes\\Thing::onUpload'","Use the special 'mediamanager' handler only for media manager uploads"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","contentChangedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}