Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This commit of #1497230: Use Dependency Injection to handle object definitions to core breaks the ability for Drush to bootstrap Drupal.
# drush status
PHP Fatal error: Class 'Symfony\Component\DependencyInjection\ContainerBuilder' not found in /home/ubuntu/drupal/core/includes/bootstrap.inc on line 2335
PHP Fatal error: Class 'Symfony\Component\DependencyInjection\ContainerBuilder' not found in /home/ubuntu/drupal/core/includes/bootstrap.inc on line 2335
Comment | File | Size | Author |
---|---|---|---|
#13 | drush-classloader-1540110-13.patch | 779 bytes | clemens.tolboom |
#9 | drush-classloader-1540110-9.patch | 667 bytes | ZenDoodles |
#4 | 1540110-3-drush-expects-valid-t-to-soon.patch | 720 bytes | clemens.tolboom |
Comments
Comment #0.0
lotyrin CreditAttribution: lotyrin commentedAdd link to commitlog
Comment #1
lotyrin CreditAttribution: lotyrin commentedMight be a core bug.
Comment #2
tim.plunkettJust a note, the RTBC patch in #1497230-128: Use Dependency Injection to handle object definitions does not resolve this.
Comment #3
tim.plunkettComment #4
clemens.tolboomDrush expects the t function to be available to early. Attached a quick patch which makes drush run again.
Guess this needs an overhaul by moving some logic into drush_bootstrap?
Comment #5
clemens.tolboomNever trust ones IDE ... netbean output looked ok :(
Comment #6
clemens.tolboomFor this to work we need to apply patch #128 from #1497230: Use Dependency Injection to handle object definitions
http://drupal.org/node/1497230#comment-5897426
Comment #7
neclimdul"Is bootsprocess"? do you mean bootstrap? Also missing trailing period.
Seems like a weird block of code but I can't think of something better ATM.
Comment #8
effulgentsia CreditAttribution: effulgentsia commentedThere's an @todo in drupal_classloader() about cleaning some stuff up, but for now, it calls variable_get(), so we shouldn't call it if we haven't even bootstrapped to DRUPAL_BOOTSTRAP_CONFIGURATION, which we haven't in this case, cause once you bootstrap to that, the classloader also contains the namespace registrations.
Perhaps the test here could simply be
drush_drupal_version() >= 8 && drupal_get_bootstrap_phase() >= DRUPAL_BOOTSTRAP_CONFIGURATION
rather than testing the loader directly?Comment #9
ZenDoodles CreditAttribution: ZenDoodles commentedRolled a patch... I assumed
function_exists('theme') was also to determine the level of bootstrap. I don't think this is the *best* solution, but it works as a temporary fix.
Comment #10
ZenDoodles CreditAttribution: ZenDoodles commentedOops. Forgot to change status...
Comment #11
lyricnz CreditAttribution: lyricnz commentedI have no idea about this Symphony stuff, but the patch in #9 fixes the
Fatal error: Class 'Symfony\Component\DependencyInjection\ContainerBuilder' not found in /Users/me/htdocs/drupal8/core/includes/bootstrap.inc on line 2351
Comment #12
clemens.tolboomThis probably breaks on Drupal 6.
Comment #13
clemens.tolboomI re-added the theme function check for Drupal 6.
Comment #14
clemens.tolboomI was still puzzled why we do not use a get_t construct? Checking the get_t() code that will not work as get_t/8 is not checking a for valid t function which is weird.
I think we should file a bug report against core about this but need some feedback on that.
[edit]
Is the comment true? That is 'Is drush while bootstrapping not in need for either st() or t() function' depending on the drush command. (sorry for the noise ... I'm working on core #1189184: OOP & PSR-0-ify gettext .po file parsing and generation ;-)
[/edit]
Anyway patch needs review.
Comment #15
neclimdulI would have just tossed a call to drupal_classload() earlier in the drush bootstrap because eventually more then t() is going to need it.
Comment #16
clemens.tolboom@neclimdul calling drupal_classload() seems like the wrong solution to me.
I personally think Drupal core is in err by having a 'bad' t function available. We now patch drush for that :(
What do you think?
Comment #17
moshe weitzman CreditAttribution: moshe weitzman commented#1541990: Improve check before calling t() (D8 drupal_container() patch broke drush). Please help fix this in Drupal, not Drush.
Comment #18
tim.plunkettThis was marked as a dupe of an issue marked won't fix. Can you point to the exact core issue where this is being worked on?
Comment #19
ZenDoodles CreditAttribution: ZenDoodles commentedLet's call it #1541990: Improve check before calling t() (D8 drupal_container() patch broke drush) @tim.plunkett since that's the one Sun reopened when I attempted a patch for core in [1590182]. I'm throwing my hands in the air on this issue. Will just continue to run drush with the patch in #9 above (which works for me on Drupal 6 too btw)...
Comment #19.0
ZenDoodles CreditAttribution: ZenDoodles commentedBetter link for commitlog