Skip to content

fix: handle MethodNotAllowedHttpException with styled 405 page - #414

Merged
navneetkumar-pim-webkul merged 3 commits into
unopim:masterfrom
dripar-webkul:fix/method-not-allowed-error-page
May 26, 2026
Merged

navneetkumar-pim-webkul merged 3 commits into
unopim:masterfrom
dripar-webkul:fix/method-not-allowed-error-page

Conversation

@dripar-webkul

Copy link
Copy Markdown
Collaborator

Catches MethodNotAllowedHttpException globally in bootstrap/app.php and returns the admin 405 view (or JSON with the Allow header) instead of Ignition's debug page when a POST-only route like /admin/catalog/products/mass-delete is hit with GET.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a global handler for MethodNotAllowedHttpException so admin users get the existing styled error page (or a JSON response including the Allow header) instead of the default debug output when an endpoint is hit with the wrong HTTP method.

Changes:

  • Render a styled 405 admin error page (or JSON) for MethodNotAllowedHttpException via bootstrap/app.php.
  • Add localized admin::app.errors.405 strings across supported admin locales.
  • Update .gitignore to ignore .mcp.json (and adjust Playwright ignore entries).

Reviewed changes

Copilot reviewed 34 out of 35 changed files in this pull request and generated no comments.

Show a summary per file
File Description
bootstrap/app.php Adds a global exception renderer for MethodNotAllowedHttpException returning admin error view or JSON with headers.
.gitignore Updates ignore patterns (Playwright artifacts / .mcp.json).
packages/Webkul/Admin/src/Resources/lang/en_US/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/en_GB/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/en_AU/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/en_NZ/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/zh_CN/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/zh_TW/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/ja_JP/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/ko_KR/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/fr_FR/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/de_DE/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/es_ES/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/es_VE/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/it_IT/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/pt_BR/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/pt_PT/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/ru_RU/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/tr_TR/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/vi_VN/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/uk_UA/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/ar_AE/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/ca_ES/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/da_DK/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/fi_FI/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/hr_HR/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/id_ID/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/mn_MN/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/nl_NL/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/no_NO/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/pl_PL/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/ro_RO/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/sv_SE/app.php Adds errors.405 title/description.
packages/Webkul/Admin/src/Resources/lang/tl_PH/app.php Adds errors.405 title/description.

@dripar-webkul
dripar-webkul changed the base branch from master to 2.1 May 25, 2026 12:35
@dripar-webkul
dripar-webkul changed the base branch from 2.1 to master May 25, 2026 13:52
@navneetkumar-pim-webkul
navneetkumar-pim-webkul merged commit a4e10a2 into unopim:master May 26, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants