Uncaught Error: Undefined class constant ‘Monolog\Utils::DEFAULT_JSON_FLAGS’
-
PHP Fatal error: Uncaught Error: Undefined class constant ‘Monolog\Utils::DEFAULT_JSON_FLAGS’
wp-content/plugins/integration-dynamics/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php:194PHP 7.4
Plugin Version:1.3.9
Wordpress Version: Version 6.0.2
-
do you have WP Rocket plugin by any chance installed? If you don’t have it, would you mind sending the list of your plugins and their versions to [email protected]?
Cheers
GeorgeHi George,
I do have wp-rocket installed.-
This reply was modified 3 years, 7 months ago by
audetcameron.
That explains it. https://github.com/wp-media/wp-rocket/issues/5366 documents a small ****storm caused by wp rocket updating their monolog library to 2.x
Long story short – WordPress does not handle these types of conflicts well, it was not very nice of WP Rocket to do it in the first place but we’re working on a patch that hopefully will get us compatibility.
Would it be possible to get the full stack when this error happens? We don’t see how possibly this constant can play any part
Cheers
GeorgeHowdy, it only happens when I use a shortcode to display a form on page. I have turned off the plugin for now until I can investigate locally.
@audetcameron it’d be really helpful if you provided the shortcode and the stack trace as we can’t reproduce the problem.
Note that shortcodes have been deprecated for a long time and are not forward-compatible. We recommend using twig codes instead. For example, instead of
[msdyncrm_form]use[msdyncrm_twig]{% form ... %}construct.If it helps, this site was using the old code and not the new twig shortcode.
[msdyncrm_form default=”{ts_leadsourceorigin:XXXXXXXXX},{ts_utm_source:”test”},{ts_ utm_medium:none},{ts_ utm_campaign:none},{ts_ utm_term:none}” entity=”lead” name=”Web Contact Form” mode=”create” captcha=”true” message=”Thank you, we’ll be in touch soon!” redirect_url=”thank-you”]
@audetcameron can you try {% view %} twig instead? Also, do you have the php log related to the error? Stack trace would be really useful
@alexacrm Do you have any updates on this? You had indicated you were working on a patch to hopefully get compatibility, but I haven’t seen any new releases of the plugin since that comment has been made.
We were waiting for @audetcameron to try non-deprecated syntax but haven’t heard back. So far we can’t work out the issue because the flag mentioned in the error simply does not exist in our code?!
Are you getting the same error message? Are you using twig {% view %}?
Yeah, we started running into issues with an integration of one of our customers. We don’t typically use the Dynamics 365 Integration plugin, so it’s really not something I’m too familiar with. In fact, it was our customer who setup the integration. The way they’re using it is on a Gravity Form using the Dynamics 365 Plugin feed to submit data into their system.
After the WP Rocket update, the Dynamics 365 Plugin was no longer able to connect. The primary area we were seeing the issue was in the Dynamics 365 settings, it was showing “Not Connected” and after entering credentials and pressing the “Connect” button it would throw a fatal error. Here’s what we were able to pull from the logs. Note these logs are truncated and slightly modified to protect customer privacy and data structure. I can attempt to get the full stack trace if necessary, but it might take some time.
An error of type E_ERROR was caused in line 194 of the file wp-content/plugins/integration-dynamics/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php. Error message: Uncaught Error: Undefined class constant ‘Monolog\Utils::DEFAULT_JSON_FLAGS’ in wp-content/plugins/integration-dynamics/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php:194
Stack trace:
#0 wp-content/plugins/integration-dynamics/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php(113): Monolog\Handler\AbstractHandler->getDefaultFormatter()
#1 wp-content/plugins/integration-dynamics/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(37): Monolog\Handler\AbstractHandler->getFormatter()
#2 wp-content/plugins/integration-dynamics/vendor/monolog/monolog/src/Monolog/Logger.php(344): Monolog\Handler\AbstractProcessingHandler->handle()
#3 wp-content/plugins/integration-dynamics/vendor/monolog/monolog/src/Monolog/Logger.php(754): Monolog\Logger->addRecord()
#4 wp-content/plugins/integration-dynamics/src/ConnectionFor the time being, we rolled WP Rocket back to to version 3.11.5, which was the release prior to the Monolog upgrade.
-
This reply was modified 3 years, 7 months ago by
The topic ‘Uncaught Error: Undefined class constant ‘Monolog\Utils::DEFAULT_JSON_FLAGS’’ is closed to new replies.