AP is designed so any module can add to it. However, that can cause performance problems if you have a bunch of queries that you aren't even using the results of. Making a UI to allow the site admin to turn off any module integration they're not using would solve this.

To think about: Use a variable for each integration or a single variable that stores all the integrations in an array. The former is easy but could have 10+ variables. The latter is neater in the table but much more of a hassle.

Michelle

Comments

crea’s picture

Just split integration to submodules, then you get isolation and configuration for free (so you dont need UI) and no code bloat

michelle’s picture

@crea: Not sure how to answer that... I can see you're trying to be helpful but what you are saying makes no sense. I think maybe you just don't know how this works and that's ok. I know what needs to be done here; this is just a reminder issue for myself.

Michelle

crea’s picture

I understand it like this: you have rich templates with lots of variables which get initialized or changed by preprocess functions, so you can split everything to smaller preprocess functions in each submodule, then disabling submodule disables preprocess automatically and template gets empty or untouched variable.

michelle’s picture

It really doesn't make sense to make a submodule for what is often < 5 lines of code. And then the user has to enable 10+ extra modules. And other maintainers have to maintain a whole extra submodule for 1 function. It's also less flexible because it's either on or off and doesn't take into account where AP is being used. Seriously, it just doesn't make sense. Turning off a preprocess would be an advanced thing for users on large sites that need to squeeze out every bit of performance and not something the average user should have to go through a lot of hassle for.

Michelle

michelle’s picture

Well, part of this is committed. I forgot that I had been working on this when I last left off and ended up committing the whole mess along with a change I did tonight. It's just a skeleton at this point, though, so not ready to be used.

Michelle

crea’s picture

I want to use author-related information in several separate blocks in a panel i.e. I need to split variables into several blocks. Problem is if I add multiple Author Panes with different $callers, probably it will be too much preprocess overhead.
Could you please explain how is hook_author_pane_allow_preprocess_disable() meant to work ? I understand that it's not working now, just want to know your thoughts about it. Will it be possible to have "caller1" run only one group of preprocesses, "caller2" another one etc ?
Another idea: some kind of static caching could help, i.e. do not run preprocess more than once for single combination of variables.

michelle’s picture

The idea was to be able to turn off preprocesses that you don't use. Like I don't display the user's groups on my panes so gathering the variable is needless overhead.

Caching is an interesting idea... That would help in the case where you have the same user in multiple posts on a forum thread. I'll file a separate issue for that as that's really a different thing.

Michelle

Canadaka’s picture

wow I commented out the contents of the author_pane_include() function and manualy included the modules files I use. Now my page loads are about 4-5 seconds faster!

michelle’s picture

This isn't committed, yet, because SSH is acting up, but I've gotten this one step closer. The logic is there to disable preprocesses but no UI. To disable a preprocess, run this bit of PHP (in a block, page set to php filter, devel, etc)

<?php variable_set("author_pane_disable_MODULE_NAME", array('CALLER' => TRUE)); ?>

I'm stumped on a good UI for this so suggestions welcome.

Michelle

michelle’s picture

Changed my mind and reversed the logic on the grounds that there are fewer callers than modules.

<?php variable_get("author_pane_disable_for_CALLER_NAME", array('MODULE' => TRUE)); ?>

Committed, now.

On the UI front, I'm leaning towards putting it in each caller. I think that would be the cleanest.

Michelle

michelle’s picture

Title: Add ability to disable preprocesses » Add UI for disabling preprocesses

Changing the title. Everything is in place except the UI. This may need to wait for a future version.

Michelle

michelle’s picture

Just a note for anyone wondering about this... I decided to go ahead and release 2.0 without this feature. It's available by code for advanced users but I don't know when I'll get to a UI. It's not a real high priority for me. Patches are welcome.

Michelle

michelle’s picture

Status: Active » Closed (won't fix)

Author Pane isn't a priority for me anymore. I'm not going to put time into this UI. If anyone else wants to write it, patches are welcome.

Michelle