Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/core#3438 Drupal: Prevent cv fatal if logging before CMS bootstrap #25728

Merged
merged 1 commit into from
Mar 3, 2023

Conversation

mlutfy
Copy link
Member

@mlutfy mlutfy commented Mar 3, 2023

Overview

https://lab.civicrm.org/dev/core/-/issues/3438

When using "Log to Drupal watchdog", using cv might fatal when logging.

To reproduce:

  • enable "Administer > System Settings > Debugging and something something > Log to Drupal watchdog like it's 1999"
  • on the CLI, run cv api system.check

Before

Fatal : " \Drupal::$container is not initialized yet. \Drupal::setContainer() must be called with a real container. "

After

no fatal

Technical Details

Copied an ugly workaround used elsewhere for i18n, from back in the days of rest.php (when the CMS is manually bootstrapped).

@civibot
Copy link

civibot bot commented Mar 3, 2023

No issue was found matching the number given in the pull request title. Please check the issue number.

@civibot
Copy link

civibot bot commented Mar 3, 2023

(Standard links)

@civibot civibot bot added the master label Mar 3, 2023
@seamuslee001
Copy link
Contributor

makes sense to me @demeritcowboy ?

@demeritcowboy
Copy link
Contributor

I was just testing based on the new info in the lab ticket. It occurs to me when CIVICRM_DEBUG_LOG_QUERY is set this generates an enormous amount of junk in drupal watchdog, but can think about that as a followup.

@demeritcowboy demeritcowboy merged commit 4d13448 into civicrm:master Mar 3, 2023
@demeritcowboy
Copy link
Contributor

I don't mean the PR generates the junk, I mean the combination of the two settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants