Since your 3.8.7: fatal error in other plugin(s)
-
After updating your plugin to 3.8.7, I started toget fatal errors on the backend. The actual error message I received was:
PHP message: PHP Fatal error: Declaration of StellarWP\Learndash\lucatume\DI52\Container::has($id)
must be compatible with Psr\Container\ContainerInterface::has(string $id): bool in …/httpdocs/wp-content/plugins/sfwd-lms/vendor-prefixed/lucatume/di52/src/Container.php on line 306.It turns out that:
- in your plugin, you updated to the latest version of the psr/container interface, which is fine and good,
- but, this interface is used in (many) other plugins that have not yet updated their code to the latest version of this interface.
- and its definition will only be (auto)loaded once, in my case apparently picking your version (i.e, your autoloader runs before that from other plugins).
I would like to ask you to solve this by:
- reverting to the older psr/container version
- while keeping your code satisfying the newer one (keep bool as return type for has()), as this is accepted by php, while the other way (not defining a return type in a class while the interface does) is not.
- I will contact the other plugin developers to ask them to do the same, so that one day we may be able to upgrade to the latest version of the psr container interface.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Since your 3.8.7: fatal error in other plugin(s)’ is closed to new replies.