After testing my site locally with Xampp on windows everyhing works ok. The site is build with Grav. PHP version 8.2.0 on Xampp, 8.2.6 online However after puting it online it gives the follopwing error:
Return value of Grav\Plugin\ProblemsPlugin::autoload() must be an instance of Composer\Autoload\ClassLoader, int returned
I already saw a question posted related to autoload() so hope to find an answer here.
I do have other Grav sites running, but never got this error. If this is not the right place to ask this question, just let me know. Ithought it might by php related and not directly related to Grav
Thanks!
I did change the php version to other versions but that did not solve it. I installed it by copying all the files to a complete empty server. Looked at a related question about autoload() on Stack Overflow
Error log says it comes from the line $instance->setAutoloader($instance->autoload()); In the file Plugins.php
public function init()
{
if ($this->plugins_initialized) {
return $this->items;
}
$grav = Grav::instance();
/** @var Config $config */
$config = $grav['config'];
/** @var EventDispatcher $events */
$events = $grav['events'];
foreach ($this->items as $instance) {
// Register only enabled plugins.
if ($config["plugins.{$instance->name}.enabled"] && $instance instanceof Plugin) {
// Set plugin configuration.
$instance->setConfig($config);
// Register autoloader.
if (method_exists($instance, 'autoload')) {
$instance->setAutoloader($instance->autoload());
}
// Register event listeners.
$events->addSubscriber($instance);
}
}
$instance->autoload()
return? Check that further, I would assume that (as given in the error message) any of the plugins returns a numberget_class($instance)
to see which plugin causes the problem