craftcms / craftcms/cms

Loading content with Ajax errors when devMode is on

Open
#3,822 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

I was trying to load another page with ajax into a modal window but I kept getting a 500 error on the url I'm trying to load. The page I'm loading loads fine if I open the url directly.

I then just started trying things and discovered that if devMode was set to false it would work correctly.
So for now I just set that in my config but would like to be able to keep devMode on.

Steps to reproduce
  1. Use sample ajax code to load another page in Craft. https://www.w3schools.com/jquery/ajax_ajax.asp
Additional info
  • Craft version: 3.1.8
  • PHP version: 7.2.x
  • Database driver & version:
  • Plugins & versions:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue using the linked sample Ajax code with Craft 3.1.8, comparing the response when devMode is enabled and disabled. Inspect the 500 response and determine what prevents the page from loading; done means the Ajax request succeeds while devMode remains enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
jquery, php
Domain
backend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.