This patch allows admins who are using devel.module to optionally toggle the page timer, query logger and page redirection for each request using GET parameters rather than navigating to admin/settings/devel and flipping the global settings back and forth. I added this since I usually don't need to print out this information for every page. Now I just use:

http://example.com/index.php?q=node&dev_query=1

for the request I'm interested in. Two other params can also be toggled: dev_timer and dev_redirect.

Comments

matt westgate’s picture

StatusFileSize
new2.82 KB

And the patch for devel.module

Steven’s picture

Perhaps we should move the trinary operator and variable_get into a small function: it would be cleaner in the code.

Steven’s picture

In fact, why not create a copy of variable_get which gets its value from the database, but overrides it with a get parameter if it exists? That would be the cleanest, it can be used in devel.module as well as elsewhere...

moshe weitzman’s picture

thats a good idea, although some implementations might want only certain users (i.e. permission check) to be able to override via _GET param. I suppose that could be handled in the calling code.

killes@www.drop.org’s picture

Status: Needs review » Needs work

I am not convinced this is neccessary.

the devel output from devel.module is sometimes a bit annoying, I admit that, but it is just one mysql statement to switch it off. :)

For me this is easier than to type a get parameter into the location bar.

If at all a devel version of variable_get would be nice.

The review brought to you by Patch Bingo!

Jaza’s picture

Version: x.y.z » 6.x-dev

I'm also not convinced that this is necessary. And I'm not sure if it's still relevant or not. Anyway, I'm assuming that it is still relevant, and moving it to 6.x queue.

If someone more knowledgeable about devel.module knows that this patch is no longer needed, feel free to close this issue.

wim leers’s picture

Project: Drupal core » Devel
Version: 6.x-dev » 7.x-1.x-dev
Component: other » Code

Doesn't affect Drupal core. Might even already be implemented in Devel module by now. If so, please close this issue.

moshe weitzman’s picture

yes it is core, and yes it is relevant. the dev_query variable is used in _db_query() which is a core function.

wim leers’s picture

Project: Devel » Drupal core
Version: 7.x-1.x-dev » 6.x-dev
Component: Code » base system

My apologies for my previous follow-up, which was completely incorrect.

In my attempt to clean up the issue queue a bit, I accidentally only looked at the second patch posted here. Which is only for devel.module, hence my incorrect conclusion.

Reverted to the state before my follow-up. Since it doesn't affect the API, I'm not pushing it to 7.x-dev.

wim leers’s picture

Version: 6.x-dev » 7.x-dev

Moving to D7.

wim leers’s picture

Status: Needs work » Closed (fixed)