Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

!!! FEATURE: update to doctrine/dbal version 3 #2637

Merged
merged 37 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
62fdca8
Update doctrine/dbal requirement from ^2.13 to ^3.2
dependabot[bot] Nov 29, 2021
a3d3b7e
TASK: Update doctrine dependencies
albe Apr 4, 2022
e07cefc
TASK: Adapt JsonArrayType to deprecated Doctrine JsonArrayType
albe Apr 4, 2022
f0ab947
TASK: Remove usage of deprecated `ping()` method
albe Apr 4, 2022
c726c64
TASK: Adjust PersistenceManagerTest to new ping method
albe Apr 4, 2022
b17b9f0
TASK: Extract ping dummy query into own method
albe Apr 4, 2022
aa59dff
TASK: Adjust tests to extracted `ping()` method
albe Apr 4, 2022
9797657
TASK: Mock `PersistenceManager::ping()` method
albe Apr 4, 2022
ec0969f
Apply fixes from StyleCI
StyleCIBot Apr 4, 2022
cdf2d83
TASK: Update Neos.Flow composer dependencies
mhsdesign Jan 15, 2024
449a46d
Merge remote-tracking branch 'origin/9.0' into dependabot/composer/do…
kitsunet Jun 23, 2024
c04ea8b
Adaptions for DBAL update
kitsunet Jun 26, 2024
b7a4f53
Test adjustments to dbal update
kitsunet Jun 26, 2024
d46baf3
Adjust PersistenceManagerTest to actual object structure
kitsunet Jun 26, 2024
7939c07
Cleaner cache pool instantiation
kitsunet Jun 26, 2024
1ee27f1
Integrate security hashes and flushing into new doctrine caches
kitsunet Jun 27, 2024
d29684b
Raise doctrine/orm version to get working lowest deps set
kitsunet Jun 27, 2024
ff72a62
Remove unnecessary use statement
kitsunet Jun 27, 2024
3d674e7
Apply suggestions from code review
kitsunet Jun 27, 2024
ede9a8b
Small cleanup in Exception (naming) for DBAL changes
kitsunet Jul 2, 2024
d91605e
Clarify method name for custom doctrine CachePool
kitsunet Jul 2, 2024
0e927f4
TASK: Replace deprecated `getSchemaManager` with `createSchemaManager`
mhsdesign Jul 4, 2024
3f0123d
Merge branch '9.0' into dependabot/composer/doctrine/dbal-tw-3.2
kitsunet Jul 6, 2024
8b1f7a3
Remove deprecated calls in Neos.Flow migrations
kitsunet Jul 7, 2024
f0d4fc9
Fix duplicate use statement due to upmerge
kitsunet Jul 7, 2024
e1a83f4
More deprecation cleanup for DBAL
kitsunet Jul 8, 2024
9c87f29
Bring doctrine dependencies in line
kitsunet Jul 9, 2024
3806d61
Remove DBAL object Type tests as it is deprecated
kitsunet Jul 9, 2024
3654601
Remove unused objectarray type which has no tests
kitsunet Jul 9, 2024
eb4c4aa
Merge branch '9.0' into dependabot/composer/doctrine/dbal-tw-3.2
kitsunet Jul 9, 2024
90c5b4b
Remove unnecessary use statement
kitsunet Jul 9, 2024
e69af07
Repository::findAllIterator returns iterable
kitsunet Jul 9, 2024
9fad259
Change migration folder resolving and allow override
kitsunet Jul 9, 2024
b869755
Replace deprecated doctrine SQLLogger interface
kitsunet Jul 9, 2024
d93b6b0
Undo DBALException case changes
kitsunet Jul 9, 2024
68aae78
Add missiong migration adaptions
kitsunet Jul 11, 2024
11e2348
Correct SqlLogger spelling
kitsunet Jul 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Neos.Flow/Classes/Persistence/Doctrine/CountWalker.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function walkSelectStatement(SelectStatement $AST)
{
$parent = null;
$parentName = null;
foreach ($this->_getQueryComponents() as $dqlAlias => $qComp) {
foreach ($this->getQueryComponents() as $dqlAlias => $qComp) {
if ($qComp['parent'] === null && $qComp['nestingLevel'] === 0) {
$parent = $qComp;
$parentName = $dqlAlias;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function create()
}

$this->emitBeforeDoctrineEntityManagerCreation($connection, $config, $eventManager);
$entityManager = EntityManager::create($connection, $config, $eventManager);
$entityManager = new EntityManager($connection, $config, $eventManager);
$flowAnnotationDriver->setEntityManager($entityManager);
$this->emitAfterDoctrineEntityManagerCreation($config, $entityManager);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use Neos\Flow\Aop\Pointcut\PointcutFilterInterface;
use Neos\Flow\ObjectManagement\Proxy\Compiler;
use Neos\Flow\Persistence\Doctrine\Mapping\Exception\ClassSchemaNotFoundException;
use Neos\Flow\Persistence\Exception;
use Neos\Flow\Reflection\ClassSchema;
use Neos\Flow\Reflection\ReflectionService;

Expand Down Expand Up @@ -426,7 +427,7 @@ public function loadMetadataForClass($className, ClassMetadata $metadata)
if (array_diff($idProperties, $metadata->getIdentifierFieldNames()) !== []) {
$uniqueIndexName = $this->truncateIdentifier('flow_identity_' . $primaryTable['name']);
foreach ($idProperties as $idProperty) {
$primaryTable['uniqueConstraints'][$uniqueIndexName]['columns'][] = isset($metadata->columnNames[$idProperty]) ? $metadata->columnNames[$idProperty] : strtolower($idProperty);
$primaryTable['uniqueConstraints'][$uniqueIndexName]['columns'][] = $metadata->fieldMappings[$idProperty]['columnName'] ?? strtolower($idProperty);
}
}
}
Expand Down Expand Up @@ -811,7 +812,7 @@ protected function evaluatePropertyAnnotations(ORM\ClassMetadataInfo $metadata)
throw ORM\MappingException::missingRequiredOption($property->getName(), 'OneToOne', sprintf('The property "%s" in class "%s" has a non standard data type and doesn\'t define the type of the relation. You have to use one of these annotations: @OneToOne, @OneToMany, @ManyToOne, @ManyToMany', $property->getName(), $className));
}
} else {
throw ORM\MappingException::propertyTypeIsRequired($className, $property->getName());
throw new Exception(sprintf('Property Type is required for %s::%s', $className, $property->getName()), 1720281797);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@

use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Event\OnFlushEventArgs;
use Doctrine\ORM\Event\PrePersistEventArgs;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Persistence\Exception\ObjectValidationFailedException;
use Neos\Flow\Reflection\ClassSchema;
use Neos\Flow\Reflection\ReflectionService;
use Neos\Flow\Validation\ValidatorResolver;
use Neos\Utility\ObjectAccess;
use Neos\Utility\TypeHandling;
use Doctrine\ORM\Event\LifecycleEventArgs;

/**
* An onFlush listener for Flow's Doctrine PersistenceManager.
Expand Down Expand Up @@ -62,10 +62,10 @@ class ObjectValidationAndDeDuplicationListener
* This removes all existing value objects in doctrines identity map. This is needed as doctrine handles their
* identity based on the object and not based on the
*
* @param LifecycleEventArgs $eventArgs
* @param PrePersistEventArgs $eventArgs
* @return void
*/
public function prePersist(LifecycleEventArgs $eventArgs)
public function prePersist(PrePersistEventArgs $eventArgs)
kitsunet marked this conversation as resolved.
Show resolved Hide resolved
{
$entityManager = $eventArgs->getObjectManager();
$unitOfWork = $entityManager->getUnitOfWork();
Expand Down Expand Up @@ -95,7 +95,7 @@ public function prePersist(LifecycleEventArgs $eventArgs)
*/
public function onFlush(OnFlushEventArgs $eventArgs)
{
$this->entityManager = $eventArgs->getEntityManager();
$this->entityManager = $eventArgs->getObjectManager();
$validatedInstancesContainer = new \SplObjectStorage();

$this->deduplicateValueObjectInsertions();
Expand Down
2 changes: 1 addition & 1 deletion Neos.Flow/Classes/Reflection/ReflectionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,7 @@ protected function expandType(ClassReflection $class, string $type): string
// and then we try to find "use" statements for the class.
$className = $class->getName();
if (!isset($this->useStatementsForClassCache[$className])) {
$this->useStatementsForClassCache[$className] = $this->getDoctrinePhpParser()->parseClass($class);
$this->useStatementsForClassCache[$className] = $this->getDoctrinePhpParser()->parseUseStatements($class);
}
$useStatementsForClass = $this->useStatementsForClassCache[$className];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ class BrokenClassImplementingDoctrineProxy
* result in an exception.
*
*/
abstract class FakePackageDomainModelBrokenClassProxy implements \Doctrine\ORM\Proxy\Proxy
abstract class FakePackageDomainModelBrokenClassProxy implements \Doctrine\Persistence\Proxy
{
}
Loading