------ ---------------------------------------------------------------------- 
  Line   src/EntityChangeDefaultLanguage.php                                   
 ------ ---------------------------------------------------------------------- 
  121    Function watchdog_exception not found.                                
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

facine created an issue. See original summary.

akash_deep’s picture

Working on this, MR coming shortly.

akash_deep’s picture

Replaced watchdog_exception() with \Drupal::logger() call. also removed the Error::logException fallback and the unused Error class import since both are unnecessary now. set to needs review.

akash_deep’s picture

Status: Active » Needs review

  • facine committed e0e9db92 on 1.x
    fix: #3580842 Function watchdog_exception not found
    

  • facine committed 0b5f62a3 on 1.x authored by akash_deep
    Issue #3580842: Replace deprecated watchdog_exception with Drupal logger
    
facine’s picture

Status: Needs review » Fixed

Thanks @akash_deep for the MR. I kept your commit and added one on top: \Drupal::logger()->error($exception->getMessage()) dropped the exception class and the backtrace, so the fallback now logs through the injected logger ($this->getLogger()) with the same context as Error::logException().

The watchdog_exception ignore is removed from phpstan.neon and phpstan passes again. A new kernel test, LoggingFallbackTest, checks that a failed save is logged with the class, the message and the backtrace.

The fallback for Drupal 9 and 10.0 stays for now. It goes away when the core requirement is raised for Drupal 12 (#3597658).

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.