getgrav/grav · error · RuntimeException
Switching Flex User object during onAdminSave event is not s
Error message
Switching Flex User object during onAdminSave event is not supported! Please update plugin.
What it means
Error "Switching Flex User object during onAdminSave event is not supported! Please update plugin." thrown in getgrav/grav.
Source
Thrown at system/src/Grav/Common/Flex/Types/Users/UserObject.php:641
$password2 = $this->getProperty('password2');
if (!\is_string($password) || ($password2 && $password !== $password2)) {
throw new \RuntimeException('Passwords did not match.');
}
$this->setProperty('hashed_password', Authentication::create($password));
}
$this->unsetProperty('password');
$this->unsetProperty('password1');
$this->unsetProperty('password2');
// Backwards compatibility with older plugins.
$fireEvents = $this->isAdminSite() && $this->getFlexDirectory()->getConfig('object.compat.events', true);
$grav = $this->getContainer();
if ($fireEvents) {
$self = $this;
$grav->fireEvent('onAdminSave', new Event(['type' => 'flex', 'directory' => $this->getFlexDirectory(), 'object' => &$self]));
if ($self !== $this) {
throw new RuntimeException('Switching Flex User object during onAdminSave event is not supported! Please update plugin.');
}
}
$instance = parent::save();
// Backwards compatibility with older plugins.
if ($fireEvents) {
$grav->fireEvent('onAdminAfterSave', new Event(['type' => 'flex', 'directory' => $this->getFlexDirectory(), 'object' => $this]));
}
return $instance;
}
/**
* @return array
*/
public function prepareStorage(): array
{View on GitHub (pinned to 6040efed04)
When it happens
Trigger: Thrown at system/src/Grav/Common/Flex/Types/Users/UserObject.php:641 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of getgrav/grav@6040efed04 (2026-08-17).
Data as JSON: /api/errors/9fbe10a120b620f8.
Report an issue: GitHub.