{"record":{"id":"e63caa11550d5075","repo":"octobercms/october","slug":"media-manager-image-crop-popup-option-alias-is-n","errorCode":null,"errorMessage":"Media Manager image crop popup option \"alias\" is not set.","messagePattern":"Media Manager image crop popup option \"alias\" is not set\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"modules/media/widgets/mediamanager/assets/js/mediamanager.imagecroppopup.js","lineNumber":47,"sourceCode":"        this.show();\n    }\n\n    dispose() {\n        this.unregisterHandlers();\n        this.removeAttachedControls();\n\n        this.$popupRootElement.remove();\n        this.$popupRootElement = null;\n        this.$popupElement = null;\n        this.selectionSizeLabel = null;\n        this.imageArea = null;\n        this.hRulerHolder = null;\n        this.vRulerHolder = null;\n    }\n\n    init() {\n        if (this.options.alias === undefined) {\n            throw new Error('Media Manager image crop popup option \"alias\" is not set.');\n        }\n\n        this.$popupRootElement = $('<div/>');\n        this.registerHandlers();\n    }\n\n    show() {\n        const data = {\n            path: this.path\n        };\n\n        this.$popupRootElement.popup({\n            extraData: data,\n            size: 'adaptive',\n            adaptiveHeight: true,\n            handler: this.options.alias + '::onLoadImageCropPopup'\n        });\n    }","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/media/widgets/mediamanager/assets/js/mediamanager.imagecroppopup.js#L29-L65","documentation":"Front-end Error thrown in the imagecroppopup.js widget's init(): the 'alias' option is undefined. The alias is the server-side MediaManager widget alias; the popup JS needs it to address the correct AJAX handler when loading crop data. Without it the widget refuses to initialise, immediately after dispose() has cleared prior DOM references.","triggerScenarios":"Instantiating the image crop popup via new $.oc.mediaManager.imageCropPopup({...}) without options.alias, or invoking it from custom JS that builds options dynamically and skips the alias key. The stock MediaManager JS passes the widget's own alias through.","commonSituations":"Custom 'crop image' buttons or Froala integrations that construct the popup manually; overriding media manager JS assets and dropping the alias from the options object; version upgrades changing which options are forwarded.","solutions":["Pass the MediaManager widget's alias in the options: alias must equal the server widget alias (the same one used in data-control=\"mediamanager\" initialization).","If you trigger cropping from custom UI, reuse the stock invocation path (the media manager's own crop command) instead of building the popup by hand.","After overriding media manager JS assets, diff against the shipped files to confirm options are forwarded intact."],"exampleFix":"// before\nconst popup = new $.oc.mediaManager.imageCropPopup({\n    path: imagePath\n});\n\n// after\nconst popup = new $.oc.mediaManager.imageCropPopup({\n    path: imagePath,\n    alias: mediaManagerAlias // e.g. the widget alias rendered by the server\n});","handlingStrategy":"validation","validationCode":"if (!options || options.alias === undefined) {\n    throw new Error('imageCropPopup requires options.alias (the MediaManager widget alias)');\n}\nnew $.oc.mediaManager.imageCropPopup(options);","typeGuard":"function hasCropPopupOptions(o) {\n    return !!o && o.alias !== undefined && typeof o.path === 'string';\n}","tryCatchPattern":null,"preventionTips":["Forward the server widget alias through every custom call site (read it from the widget root's data attributes).","Prefer reusing the stock media manager crop command over manual popup instantiation.","Diff overridden media manager assets after every CMS upgrade."],"tags":["media-manager","crop-popup","javascript","widget-options","frontend"],"backgroundTag":"missing-required-option","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}