Skip to content

Commit d518c27

Browse files
authored
Merge pull request #16655 from alrieckert/5.0.x
Include the reference model name in the build query when getting rela…
2 parents 738cbdf + 446c8f4 commit d518c27

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG-5.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
- Fixed `Phalcon\Encryption\Crypt` to use `strlen` instead of `mb_strlen` for padding calculations [#16642](https://github.com/phalcon/cphalcon/issues/16642)
1515
- Fixed `Phalcon\Filter\Validation\Validator\File\MimeType::validate` to close the handle when using `finfo` [#16647](https://github.com/phalcon/cphalcon/issues/16647)
16+
- Fixed `Phalcon\Mvc\Model\Manager::getRelationRecords` to explicitly set the `referencedModel` in the conditions along with the `referencedFields` [#16655](https://github.com/phalcon/cphalcon/pull/16655)
1617
- Fixed `Phalcon\Image\Adapters\AbstractAdapter::watermark` to correctly calculate the Y offset [#16658](https://github.com/phalcon/cphalcon/issues/16658)
1718

1819
### Removed

phalcon/Mvc/Model/Manager.zep

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,11 +1460,11 @@ class Manager implements ManagerInterface, InjectionAwareInterface, EventsAwareI
14601460
let referencedFields = relation->getReferencedFields();
14611461

14621462
if typeof fields != "array" {
1463-
let conditions[] = "[". referencedFields . "] = :APR0:",
1463+
let conditions[] = "[" . referencedModel . "].[". referencedFields . "] = :APR0:",
14641464
placeholders["APR0"] = record->readAttribute(fields);
14651465
} else {
14661466
for refPosition, field in relation->getFields() {
1467-
let conditions[] = "[". referencedFields[refPosition] . "] = :APR" . refPosition . ":",
1467+
let conditions[] = "[" . referencedModel . "].[". referencedFields[refPosition] . "] = :APR" . refPosition . ":",
14681468
placeholders["APR" . refPosition] = record->readAttribute(field);
14691469
}
14701470
}

0 commit comments

Comments
 (0)