Skip to content

call $controller->commit() outside of foreach loop#27

Open
lyrapet wants to merge 1 commit intojtl-software:masterfrom
lyrapet:fix-transactionalinterface-handling
Open

call $controller->commit() outside of foreach loop#27
lyrapet wants to merge 1 commit intojtl-software:masterfrom
lyrapet:fix-transactionalinterface-handling

Conversation

@lyrapet
Copy link

@lyrapet lyrapet commented Sep 17, 2025

Commit b3b00eb broke the TransactionalInterface Controller handling. It starts the transaction with $controller->beginTransaction() at the beginning, calls the $controller->commit() however multiple times inside the foreach loop which should only happen once at the end of the try...catch block because you can't commit a transaction more than once. This will throw if more than 1 model has been passed to a Controller which implements the TransactionalInterface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants