Jack-Dane / odoo-wp-plugin

Odoo WordPress Plugin
GNU General Public License v3.0
8 stars 4 forks source link

Undefined class constant 'MAJOR_VERSION' in Utils.php #37

Closed arminpkathrein closed 5 months ago

arminpkathrein commented 5 months ago

Describe the bug When I try to use a gmail plugin to send an test email I get this error and the test email won't be send. If I set the version hardcoded in this file of the vendor, then everything works fine. This is the log file: PHP Fatal error: Uncaught Error: Undefined class constant 'MAJOR_VERSION' in /var/www/html/wp-content/plugins/odoo-wp-plugin/vendor/guzzlehttp/guzzle/src/Utils.php:116

Expected behavior The MAJOR_VERSION should be set, and no PHP error should show up. Platform versions:

Jack-Dane commented 5 months ago

@arminpkathrein, thanks for the bug ticket.

It looks like the issue is that another plugin has a different guzzle version installed.

A few similar sources:

Can you confirm if you have another plugin installed in your WordPress instance that uses guzzle?

I think a solution would be to upgrade the other WordPress plugin that uses guzzle to the latest version 7.8.1 (if it supports it).

arminpkathrein commented 5 months ago

Yes, that is exactly the issue. There is a plugin called "Gmail-SMTP" https://wordpress.org/plugins/gmail-smtp/ They are using V6. Thanks for the info, you can close this ticket.

Jack-Dane commented 5 months ago

There might be another issue here, I think this plugin only uses guzzle for the tests.

I will confirm this and remove it from the default dependencies if that is the case - to avoid issues like this.