Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: devMode per user #4765

Closed
ghost opened this issue Aug 16, 2019 · 4 comments
Closed

Feature Request: devMode per user #4765

ghost opened this issue Aug 16, 2019 · 4 comments

Comments

@ghost
Copy link

ghost commented Aug 16, 2019

You should be able to enable devMode per user and globally using the general config. You would enable devMode from the user preferences tab, the same way you enable the Yii debug bar.

This is especially useful when trying to find the cause of an error on your production env without having to enable devMode. Because sometimes you encounter errors on your production site which you cannot reproduce locally.

@ghost ghost changed the title FR: devMode per user Feature Request: devMode per user Aug 16, 2019
@brandonkelly
Copy link
Member

“Dev Mode” is really just the Craft name for the YII_DEBUG constant, which needs to be set very early on in the application bootstrap phase, well before we can find out if someone is logged in. So this isn’t possible unfortunately.

@gtettelaar
Copy link
Contributor

@brandonkelly Whilst that may be true I think there is a middle ground.

Obviously, you can use the debug toolbar on the Frontend to find errors when they pop up in production. However, the "Dev Mode` error view is far better IMO.

@tim-pixeldeluxe 's underlying issue was specifically focusing on debugging in production. If an error happens there you get a pretty vague Internal Server Error which doesn't tell you much - unless you have a custom error template which should still give a pretty vague message. This is perfect for the site's users. For dev's though, there is room for improvement.

My suggestion is this: Add an option to display the Dev Mode error view in production on a user by user basis (as the FR mentions).

Overriding craft\web\ErrorHandler::renderException() will allow us to add a condition that checks if a user has enabled that setting and render the specific error file - regardless of what Yii's error handler wants. That should improve the debugging experience sufficiently. I don't think the other Dev Mode features are required on a production site. Just this one.

Already played around with this a bit so happy to submit a proposal PR for 3.3. if you want.

@brandonkelly
Copy link
Member

Yeah that wouldn’t hurt.

@brandonkelly
Copy link
Member

Sorry, forgot to update this issue, but what @gtettelaar suggested/PR’d has been implemented for 3.3.

This issue was closed.
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

No branches or pull requests

2 participants