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

Mautic API not working with Psr/Log v3 #312

Open
rebbieboi opened this issue Sep 19, 2023 · 5 comments
Open

Mautic API not working with Psr/Log v3 #312

rebbieboi opened this issue Sep 19, 2023 · 5 comments

Comments

@rebbieboi
Copy link

Declaration of Mautic\Api\Api::setLogger(Psr\Log\LoggerInterface $logger) must be compatible with Psr\Log\LoggerAwareInterface::setLogger(Psr\Log\LoggerInterface $logger): void {"userId":27,"exception":"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Declaration of Mautic\Api\Api::setLogger(Psr\Log\LoggerInterface $logger) must be compatible with Psr\Log\LoggerAwareInterface::setLogger(Psr\Log\LoggerInterface $logger): void at /vendor/mautic/api-library/lib/Api/Api.php:127)

I fixed this by forcing "psr/log": "~2.0". Note that I'm using Laravel 10 which I think upgraded it to v3.0

I'm also using: "mautic/api-library": "^3.1.0",

@escopecz
Copy link
Sponsor Member

Can you try updating to the changes in the main branch? It should have been fixed there but not yet released.

@rebbieboi
Copy link
Author

Can you try updating to the changes in the main branch? It should have been fixed there but not yet released.

not too sure how to do that. But I'll just wait for the official release. Do we know when that would be? Thank you!

@escopecz
Copy link
Sponsor Member

Here is how to checkout a branch with Composer: https://getcomposer.org/doc/articles/versions.md#branches

There is no release date at the moment.

@michaelandre0
Copy link

michaelandre0 commented Dec 6, 2023

Had the same error, I managed to solve it by activating the PSR extension in PHP. In my case the PSR extension was not activated by default on my install.

theodorosploumis added a commit to theodorosploumis/api-library that referenced this issue Mar 5, 2024
@theodorosploumis
Copy link

Since I cannot create a PR for a git tag here is a patch for tag 3.1.0 (taken from https://github.com/mautic/api-library/compare/3.1.0...theodorosploumis:api-library:3.1.0.patch)

mautic_api_3.1.0_psr_log_v3.PATCH

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

No branches or pull requests

4 participants