diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index aef344823..867026a87 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -23,6 +23,7 @@ jobs: - "8.2" - "8.3" - "8.4" + - "8.5" mongodb-version: - "8.0" - "7.0" diff --git a/src/Aggregation/Stage/VectorSearch.php b/src/Aggregation/Stage/VectorSearch.php index 85c1f9d86..8fedc2da1 100644 --- a/src/Aggregation/Stage/VectorSearch.php +++ b/src/Aggregation/Stage/VectorSearch.php @@ -82,7 +82,7 @@ public function getExpression(): array } if ($this->queryVector !== null) { - $params['queryVector'] = Type::getType($this->persister->getClassMetadata()->fieldMappings[$this->path]['type'] ?? Type::RAW)->convertToDatabaseValue($this->queryVector); + $params['queryVector'] = Type::getType($this->persister->getClassMetadata()->fieldMappings[$this->path ?? '']['type'] ?? Type::RAW)->convertToDatabaseValue($this->queryVector); } return [$this->getStageName() => $params]; diff --git a/src/Persisters/DocumentPersister.php b/src/Persisters/DocumentPersister.php index c74c668fe..08045c735 100644 --- a/src/Persisters/DocumentPersister.php +++ b/src/Persisters/DocumentPersister.php @@ -706,7 +706,7 @@ private function loadEmbedManyCollection(PersistentCollectionInterface $collecti $this->uow->setParentAssociation($embeddedDocumentObject, $mapping, $owner, $mapping['name'] . '.' . $key); $data = $this->hydratorFactory->hydrate($embeddedDocumentObject, $embeddedDocument, $collection->getHints()); - $id = $data[$embeddedMetadata->identifier] ?? null; + $id = $data[$embeddedMetadata->identifier ?? ''] ?? null; if (empty($collection->getHints()[Query::HINT_READ_ONLY])) { $this->uow->registerManaged($embeddedDocumentObject, $id, $data); @@ -994,7 +994,7 @@ public function prepareFieldName(string $fieldName): string */ public function addDiscriminatorToPreparedQuery(array $preparedQuery): array { - if (isset($preparedQuery[$this->class->discriminatorField]) || $this->class->discriminatorField === null) { + if ($this->class->discriminatorField === null || isset($preparedQuery[$this->class->discriminatorField])) { return $preparedQuery; }