Select múltiple and expanded widget in a form type class(CustomReport and AccessLog entities). When the form is persisted (CustomReportType), something strange happens: the relationship is stored correctly in the resulting table and an update statement is also executed on one field of the related entity (AccessLog) for each existing record in the table, and there is no lifecycle event that triggers it. I've been struggling with this for several days and I can't find a solution. Some idea!?
If I set expanded property to false, then the stranges update quantities correspond with the number of options selected in the SELECT widget.
Symfony/Doctrine versions, gist code examples? Are you sure that there are no other non-doctrine listeners or database triggers by themselves?
Hi, Symfony 6.3. I'm sure there are no listeners or lifecycles events on these entities. CustomReportType class: https://gist.github.com/frizquierdo/01728a0a3744e1c3022a1491c1928336 CustomReport entity: https://gist.github.com/frizquierdo/55dbf8ae514f699bc80dc039dbafece7 AccessLog entity: https://gist.github.com/frizquierdo/b3c4e4cf93566e381edd2fe0f77d858f Custom report action persist: https://gist.github.com/frizquierdo/d7e2895c011d6db55a6c298559a20086 Log registry for persist operation (action): https://gist.github.com/frizquierdo/1ff5d7d6240e3ac470549665ff237aea Why all those UPDATE access_log SET consumo = ? WHERE id = ? (parameters: array{"1":1204916663,"2":1}, types: array{"1":2,"2":1}).....
$this->accessLogRepository->createQueryBuilder('al')->orderBy('al.fecha', 'DESC') get all entity to UnitOfWork, they will always be updated
Is there some way to obtain that collection ordered for form type without updating the unitOfWork?
Michel Angelo nop, I've removed the query_builder from widget definition and orderby from Entity field definition, and updates continue.
Обсуждают сегодня