refactor: replace legacy database result handling#765
refactor: replace legacy database result handling#765anonymoususer72041 wants to merge 6 commits into
Conversation
|
@RussH before merging, we should discuss a few things:
|
|
@Frankli9986's PR #771 seems to be a partial duplicate of this PR.
As mentioned above, this PR may resolve multiple existing issues. One example could be #572, since @Frankli9986's PR specifically targets that issue and overlaps with the
Even if this PR fixes #572, I am still not sure whether changing old migrations is the best long-term approach. For example, I am currently looking into a new standardized migration system, possibly based on something like Phinx. If we go in that direction, the current migration system and the migration definitions in After checking the demo content installation flow in the current master branch, I think the more fundamental issue is that the demo install is based on an old backup snapshot. It loads Maybe we could eventually solve this in a similar direction as #716: instead of keeping and patching another old database fixture, the demo data could be rebased onto the current canonical schema or regenerated in a way that no longer requires replaying old install migrations. That would make the changes in this PR and #771 useful as short-term compatibility fixes, but not necessarily the final solution for #572. |
This PR removes obsolete legacy MySQL calls and reduces direct mysqli result handling in selected database-related areas by routing them through the existing DatabaseConnection API.
The install schema no longer uses obsolete mysql_* calls and install-module result handling now relies more consistently on the existing database helpers. Backup-related database access in settings and script code is also routed through the existing connection handling while preserving row-by-row processing where appropriate.
ControlPanel database result handling has been updated to use DatabaseConnection methods for row fetching, row counts, affected rows and inserted IDs instead of direct mysqli_* calls. The count-row handling was also adjusted to explicitly read the named count column rather than relying on the previous mysqli_fetch_row() pattern.
Database tests were extended to cover the normalized query handling patterns used by these changes, especially calling getAssoc() after a prior query() and iterating over the active result set. Obsolete database comments and dead examples referencing legacy mysql_* APIs were also cleaned up.