Affecting all versions of DRUPAL!
(Patch is for HEAD)
When e.g drupal_bootstrap(DRUPAL_BOOTSTRAP_PATH) is called twice (e.g by statistic and by another custom module) _drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL) is also executed.
It took me 4 hours to find this bug:I got "Cannot modify header information -..." at loading pages from cache. It turned out that after serving cached pages DRUPAL_BOOTSTRAP_FULL was also executed.
Although it affects all version of drupal, it affects few users, since not many contrib modules calls drupal_bootstrap() with a $phase smaller than DRUPAL_BOOTSTRAP_FULL.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | bootstrap_26.patch | 986 bytes | keve |
| #6 | bootstrap_25.patch | 1012 bytes | keve |
| #4 | bootstrap_24.patch | 1012 bytes | keve |
| bootstrap_22.patch | 987 bytes | keve |
Comments
Comment #1
keve commentedAny opinions?
Comment #2
Delete Me-1 commentedbump....
Comment #3
ChrisKennedy commentedYep, the bootstrap handling needs a bit of work. This is a good step. I have a few minor suggestions - take em or leave em.
I think the comment would be clearer if it read: "// Stop early if $phase was already executed."
It might also be clearer to change the IF logic to something like:
if (empty($phases) || ($phase < min($phases)))Then the comment might be best as "// Stop early if no phases are remaining or if $phase was already executed."
Comment #4
keve commentedI included your suggestions. Rerolled to head.
Comment #5
ChrisKennedy commentedThat IF statement needs to be || instead of && so that it short circuits the min() - otherwise it will give an error.
Comment #6
keve commentedWoops. You are right. - Where was my mind? ;)
Comment #7
chx commentedi do not like the implementation. Checking for emptiness is pointless, while will nicely FALSE . that min() defies the point of constants. Why not an in_array() ?
Comment #8
keve commentedComment #9
mfer commentedI like this patch. If early phases have been executed you can still execute later ones. Yet, it returns when it's called into a phase that's already done.
Looks good to me and works.
Comment #10
ChrisKennedy commentedComment #11
gábor hojtsyPatch looks good, committed!
Comment #12
(not verified) commented