Problem/Motivation
The function watchdog_exception() is deprecated, and replaced by \Drupal\Core\Utility\Error::logException()
Steps to reproduce
$ vendor/bin/drupal-check --drupal-root $CI_PROJECT_DIR/$_WEB_ROOT $CI_PROJECT_DIR/$_WEB_ROOT/modules/custom/$CI_PROJECT_NAME
------ -----------------------------------------------------------
Line src/Service/RebuildIpAddressService.php
------ -----------------------------------------------------------
59 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
------ -----------------------------------------------------------
------ -----------------------------------------------------------
Line src/Service/RebuildRouteService.php
------ -----------------------------------------------------------
64 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
78 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
98 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
------ -----------------------------------------------------------
------ -----------------------------------------------------------
Line src/Service/TrackerService.php
------ -----------------------------------------------------------
210 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
------ -----------------------------------------------------------
------ -----------------------------------------------------------
Line visitors.install
------ -----------------------------------------------------------
393 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
551 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
571 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
590 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
609 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
628 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
647 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
666 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
685 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
704 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
723 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
777 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
912 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
926 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
1044 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
2631 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
------ -----------------------------------------------------------
------ -----------------------------------------------------------
Line visitors.module
------ -----------------------------------------------------------
69 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
324 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
374 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
396 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
443 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
479 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
------ -----------------------------------------------------------
------ ----------------------------------------------------------------
Line visitors_geoip/src/EventSubscriber/GeoIpVisitLogSubscriber.php
------ ----------------------------------------------------------------
86 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
------ ----------------------------------------------------------------
Proposed resolution
Remaining tasks
This cannot be merged until Drupal 9 is End of Life.
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|
Issue fork visitors-3392006
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
Comment #2
shreya_th commentedComment #3
shreya_th commentedHi @bluegeek9,
I have fixed this issue i.e. watchdog_exception() deprecated in RebuildIpAddressService.php. Kindly review the attached patch file.
Comment #4
bluegeek9 commentedHi @Shareya_th,
Here is an example of replacing watchdog_exception() with Error::logException():
https://git.drupalcode.org/project/search_api/-/merge_requests/87/diffs
Comment #5
shreya_th commentedComment #6
shreya_th commentedComment #7
sarwan_verma commentedComment #8
sarwan_verma commentedHi @bluegeek9,
I have fixed this issue watchdog_exception() and also attached patch,
please review and verify.
Comment #9
sarwan_verma commentedComment #11
bluegeek9 commentedThe pull request looks good. I am postponing merging since Drupal 9 will not work with this change. I don't want to drop support for D9 yet.
Comment #12
trackleft2Aren't the use statements incorrect?
use \Drupal\Core\Utility\Error;Should be
use Drupal\Core\Utility\Error;Comment #13
bluegeek9 commented@trackleft2,
You are correct, but you also need to look at the merge request, not the patch(es).
https://git.drupalcode.org/project/visitors/-/merge_requests/104/diffs
Comment #14
bluegeek9 commentedComment #17
bluegeek9 commentedThis issue was resolved. A new release, 8.x-2.17, will be made soon, May 31st.
This is an excellent opportunity to beta test the dev branch, and report any issues.
Contributors (5)
bluegeek9, roshni27, abhishek_gupta1, sarwan_verma, SandeepSingh199
Changelog
Issues: 32 issues resolved.
Changes since 8.x-2.16:
Bug
Feature
Task