---
title: "Changelog"
description: "The changes of each release of Phalcon 5.21."
version: "5.21"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.phalcon.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Changelog

The changes of each release that this documentation covers, newest first. The source is [`CHANGELOG-5.0.md`](https://github.com/phalcon/cphalcon/blob/master/CHANGELOG-5.0.md) of the repository.

## [5.21.0](https://github.com/phalcon/cphalcon/releases/tag/v5.21.0) (2026-09-18)

### Tools

- Zephir 1.5.0

### Changed

- `Phalcon\Db\Adapter\Pdo\AbstractPdo::commit()` and `rollback()` now throw `Phalcon\Db\Exceptions\NoActiveTransaction` when the connection has no active transaction, instead of sending a commit, rollback or savepoint statement to the server. [#17546](https://github.com/phalcon/cphalcon/issues/17546) [[doc]](https://docs.phalcon.io/5.21/db-layer/)

### Added

- `Phalcon\Mvc\Model::findFirst()` now recognizes the `eager` parameter, so relations can be eagerly loaded. [#17534](https://github.com/phalcon/cphalcon/issues/17534) [[doc]](https://docs.phalcon.io/5.21/db-models/)

### Fixed

- PHQL `WITH` naming a model instead of a relation alias always throwing `RelationshipNotFound`; the fallback checked `Phalcon\Mvc\Model\Manager::getRelationsBetween()` for an object, but it returns an array. Ambiguous pairs now throw `AmbiguousJoinRelation`. [#17554](https://github.com/phalcon/cphalcon/issues/17554) [[doc]](https://docs.phalcon.io/5.21/db-models/)
- PHQL string literals not resolving their escape sequences, so `\n` reached the database as a backslash and an `n`. [#17585](https://github.com/phalcon/cphalcon/issues/17585) [[doc]](https://docs.phalcon.io/5.21/db-phql/)
- `Phalcon\Db\Adapter\Pdo\AbstractPdo` leaving the transaction nesting level wrong when `begin()`, `commit()` or `rollback()` fails. [#17546](https://github.com/phalcon/cphalcon/issues/17546) [[doc]](https://docs.phalcon.io/5.21/db-layer/)
- `Phalcon\Filter\Validation\Validator\File\AbstractFile::checkUpload()` reporting success when the field value is not an uploaded file array; a missing file or a plain string now fails validation. [#17541](https://github.com/phalcon/cphalcon/issues/17541) [[doc]](https://docs.phalcon.io/5.21/filter-validation/)
- `Phalcon\Filter\Validation\Validator\File\Resolution\Equal`, `Max`, `Min` and `AspectRatio` not checking the `false` returned by `getimagesize()`; a file that is not a readable image is now rejected. [#17542](https://github.com/phalcon/cphalcon/issues/17542) [[doc]](https://docs.phalcon.io/5.21/filter-validation/)
- `Phalcon\Filter\Validation\Validator\Ip` ignoring per-field `allowPrivate` and `allowReserved` arrays; the option is now resolved for the field before it becomes a filter flag. [#17548](https://github.com/phalcon/cphalcon/issues/17548) [[doc]](https://docs.phalcon.io/5.21/filter-validation/)
- `Phalcon\Forms\Element\CheckGroup` and `RadioGroup` storing their choices in the property `Phalcon\Forms\Element\AbstractElement` uses for user options, so `setUserOption()` added a choice and `setOptions()` removed every user option. [#17536](https://github.com/phalcon/cphalcon/issues/17536) [[doc]](https://docs.phalcon.io/5.21/forms/)
- `Phalcon\Forms\Element\Select::addOption()` writing with an offset into an object or `null` options value; the write now happens only when the options value is an array (`null` becomes an empty array). [#17536](https://github.com/phalcon/cphalcon/issues/17536) [[doc]](https://docs.phalcon.io/5.21/forms/)
- `Phalcon\Mvc\Model\Manager::getRelationRecords()` raising `TypeError` on a compound through-relation marked `reusable`, and reusing one key for every record. The key is now built from every field the relation covers. [#17560](https://github.com/phalcon/cphalcon/issues/17560) [[doc]](https://docs.phalcon.io/5.21/db-models-relationships/)
- `Phalcon\Mvc\Model\Manager` relation guards throwing `TypeError` on a string field list, and the second check in `addHasManyToMany()` / `addHasOneThrough()` comparing the same pair twice. [#17556](https://github.com/phalcon/cphalcon/issues/17556) [[doc]](https://docs.phalcon.io/5.21/db-models/)
- `Phalcon\Mvc\Model\Resultset::valid()` reporting no row for a resultset restored from cache; `Phalcon\Mvc\Model\Resultset\Complex` stores rows that are already hydrated, so they are objects and not arrays. [#17574](https://github.com/phalcon/cphalcon/issues/17574) [[doc]](https://docs.phalcon.io/5.21/db-models/)
- `Phalcon\Mvc\Model\Resultset\Simple::current()` giving back `false` on a second call at a position with no row; the `false` it caches is a sentinel, and `null` is returned as the declared type says. [#17568](https://github.com/phalcon/cphalcon/issues/17568) [[doc]](https://docs.phalcon.io/5.21/db-models/)
- `Phalcon\Mvc\Model` raising `TypeError` on a composite virtual foreign key violation, and when the case-insensitive column-map lookup ran without a column map. [#17558](https://github.com/phalcon/cphalcon/issues/17558) [[doc]](https://docs.phalcon.io/5.21/db-models/)
- `Phalcon\Mvc\View\Engine\Volt::preload()` raising an error when the engine has no container; the href is given back unchanged. `Phalcon\Mvc\View\Engine\Volt\Compiler::compileSource()` returning `null` in extends mode when the template contributes no blocks. [#17565](https://github.com/phalcon/cphalcon/issues/17565) [[doc]](https://docs.phalcon.io/5.21/volt/)
- `Phalcon\Storage\Adapter\Stream` and `Phalcon\Queue\Adapter\Stream\StreamContext` reporting a `mkdir(): File exists` warning when a different process makes the directory first. [#17561](https://github.com/phalcon/cphalcon/issues/17561) [[doc]](https://docs.phalcon.io/5.21/storage/)

[keep_a_changelog]: https://keepachangelog.com/en/1.1.0/
[semantic_versioning]: https://semver.org/spec/v2.0.0.html

Source: https://docs.phalcon.io/5.21/changelog/index.mdx
