Affected Version
2025.4 - LTS
Affected capability
User/Permission/Role
Steps to reproduce
- Register a listener on pimcore.user.preUpdate that throws Pimcore\Model\Element\ValidationException so a Studio user save is rejected. Example:
<?php
declare(strict_types=1);
namespace App\EventListener;
use Pimcore\Event\Model\UserRoleEvent;
use Pimcore\Model\Element\ValidationException;
use Pimcore\Model\User;
class BackendUserValidationListener
{
public function onPreUpdate(UserRoleEvent $event): void
{
$user = $event->getUserRole();
if (!$user instanceof User) {
return;
}
$errors = [];
$firstname = trim((string) $user->getFirstname());
if (strlen($firstname) < 3) {
$errors[] = 'First Name must be at least 3 characters';
}
$lastname = trim((string) $user->getLastname());
if (strlen($lastname) < 3) {
$errors[] = 'Last Name must be at least 3 characters';
}
$email = trim((string) $user->getEmail());
if (empty($email)) {
$errors[] = 'Email Address is required';
} elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$errors[] = 'Email Address is not valid';
}
if (!$user->getAdmin() && empty($user->getRoles())) {
$errors[] = 'User Role is required';
}
if (!empty($errors)) {
$message = "Please ensure all required fields are filled:\n"
. implode("\n", array_map(fn($e) => '• ' . $e, $errors));
throw new ValidationException($message);
}
}
}
# config/services.yaml
App\EventListener\BackendUserValidationListener:
tags:
- {
name: kernel.event_listener,
event: pimcore.user.preUpdate,
method: onPreUpdate,
}
- Open Studio Users and open any existing user.
- Clear First name (or set it to fewer than 3 characters) so the listener fails.
- Click Save.
Actual Behavior
The error toast is shown
Then the Users widget crashes and is replaced by:
Cannot read properties of undefined (reading 'toString')
The Users view stays broken until a full browser reload.
Expected Behavior
The save is rejected. An error toast is shown. The Users widget stays open and the form keeps the values that were entered.
Hoping this is already fixed in the latest version we’ll migrate to (2026.2.x).
Affected Version
2025.4 - LTS
Affected capability
User/Permission/Role
Steps to reproduce
Actual Behavior
The error toast is shown
Then the Users widget crashes and is replaced by:
Cannot read properties of undefined (reading 'toString')
The Users view stays broken until a full browser reload.
Expected Behavior
The save is rejected. An error toast is shown. The Users widget stays open and the form keeps the values that were entered.
Hoping this is already fixed in the latest version we’ll migrate to (2026.2.x).