This is a patch which changes significantly the work of autocomplete. Instead of loading the full Drupal and using the menu system to find out the correct handler, we only bootstrap to the PAGE_CACHE phase, and load the necessary module only. Autocomplete functions need to check for permissions themselves!

Comments

chx’s picture

StatusFileSize
new971 bytes

Here is the autocomplete.php which makes this work.

walkah’s picture

+1 for the functionality *BUT*

I'd like to see something similar used for files as well (i.e. private and/or permisisons on files) ... *and* i'd really rather see this incorporated into index.php ... i.e. a single end point. perhaps some $_GET (or safer for $_SESSION?) triggers that indicate bootstrap levels .

note gallery2 (i.e. http://gallery.menalto.com) uses a system sort of like this ... i.e. there is 2 init processes and for "item downloading" (i.e. fetching an image) only a partial init is done (enough to verify permissions).

that is to say - let's see if we can't generalize this to accomodate file fetching as well as ajax stuff, etc.

chx’s picture

StatusFileSize
new11.14 KB

I made a grave error which would've blown a security hole.

chx’s picture

StatusFileSize
new969 bytes

autocomplete function name is hardwired.

chx’s picture

StatusFileSize
new11.12 KB

Doh, I left in a mention of $function.

praseodym’s picture

A more general solution would be prefered but I think it's a good thing to have this in as soon as possible. Main reasons are faster AJAX response (that is what AJAX is all about, isn't it?) and decreased server load.

chx’s picture

What you do not want is to load all modules. That means -- full menu can't be used, neither can be full node_access. This needs quite some thought.

I think the functionality here needs to be in Drupal 4.7 but more general stuff now needs to wait a release.

moshe weitzman’s picture

i can't decide if this is needed for 4.7 or not. i do agree that we need a more broad solution for 4.8.

how about we add a new bootstrap hook which is guaranteed to run during PAGE_CACHE phase? modules can handle the request from there. this idea is less than halkf baked but i think it is general enough to handle anyone who wants to do these mini page requests.

drumm’s picture

Status: Needs review » Needs work

No longer applies.

coreb’s picture

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

moving from x.y.z to 6.x-dev version queue

wim leers’s picture

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

Moving to 7.x-dev

wim leers’s picture

Status: Needs work » Closed (duplicate)

IIRC, Drupal 7 will be able to set special menu callbacks, which will result in automatic light-weight bootstrapping. That would make this issue obsolete.

moshe weitzman’s picture

Well, it will if we can convince Dries to commit the registry patch. We are having trouble. Please add a thoughtful review at http://drupal.org/node/221964