When editing a booking, services that were previously booked but are no
longer available in the travel catalog were being dropped. This caused
API error 650 ("Anzahl Leistung stimmt nicht mit Teilnehmerzuordnung
überein") because the service participant counts no longer matched.
The fix ensures that in edit mode, booked services are merged with
travel data services in both:
- Form rendering (ParticipantFieldOptionsProvider): so checkboxes appear
- Handler validation (AbstractParticipantFieldHandler): so selections
are accepted
This allows users to keep their existing service selections or
deliberately replace them with other available options. Create mode
remains unchanged.
45 lines
1.3 KiB
PHP
45 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Controller\Admin;
|
|
|
|
use App\Entity\User;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Config\Action;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Config\Actions;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Field\DateTimeField;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
|
|
|
|
class UserCrudController extends AbstractCrudController
|
|
{
|
|
public static function getEntityFqcn(): string
|
|
{
|
|
return User::class;
|
|
}
|
|
|
|
public function configureActions(Actions $actions): Actions
|
|
{
|
|
return $actions
|
|
->remove(Crud::PAGE_INDEX, Action::NEW)
|
|
->remove(Crud::PAGE_INDEX, Action::EDIT)
|
|
->remove(Crud::PAGE_INDEX, Action::DELETE)
|
|
;
|
|
}
|
|
|
|
public function configureCrud(Crud $crud): Crud
|
|
{
|
|
return $crud
|
|
->setEntityLabelInSingular('Benutzeraccount')
|
|
->setEntityLabelInPlural('Benutzeraccounts')
|
|
->setDefaultSort(['lastLoginAt' => 'DESC']);
|
|
}
|
|
|
|
public function configureFields(string $pageName): iterable
|
|
{
|
|
return [
|
|
TextField::new('email', 'E-Mail'),
|
|
DateTimeField::new('lastLoginAt', 'letzter Login'),
|
|
];
|
|
}
|
|
}
|