Skip to content

Conversation

@michalsn
Copy link
Member

Description
This PR fixes an encapsulation violation where BasePreparedQuery was directly accessing the protected property BaseConnection::$transStatus, which goes against PHP’s visibility rules.

To resolve this, I introduced a new internal method, BaseConnection::handleTransStatus(), which provides controlled access for modifying the transaction status when a query fails during an active transaction.

The issue was originally spotted in the forum: https://forum.codeigniter.com/showthread.php?tid=93029

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@michalsn michalsn added the bug Verified issues on the current code behavior or pull requests that will fix them label Jun 17, 2025
@michalsn michalsn merged commit 863faee into codeigniter4:develop Jun 22, 2025
50 checks passed
@michalsn
Copy link
Member Author

Thank you @paulbalandan and @TimexPeachtree

@michalsn michalsn deleted the fix/prepared-query-transactions branch June 25, 2025 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Verified issues on the current code behavior or pull requests that will fix them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants