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

fix Doctrine deprecations #1667

Merged
merged 1 commit into from
Jun 4, 2023
Merged

Conversation

dmaicher
Copy link
Contributor

@dmaicher dmaicher commented Jun 2, 2023

Partly fixes #1665

  • The "url" connection parameter is deprecated (@stof is looking into it)
  • DebugStack is deprecated.
  • In ORM 3.0, the AttributeDriver will report fields for the classes where they are declared. This may uncover invalid mapping configurations. To opt into the new mode today, set the "reportFieldsWhereDeclared" constructor parameter to true.
  • Doctrine\DBAL\Connection::getEventManager is deprecated
  • Doctrine\DBAL\Platforms\AbstractPlatform::usesSequenceEmulatedIdentityColumns is deprecated (See DBAL deprecation: AbstractPlatform::usesSequenceEmulatedIdentityColumns is deprecated orm#10744)

DependencyInjection/DoctrineExtension.php Outdated Show resolved Hide resolved
Tests/Dbal/Logging/BacktraceLoggerTest.php Outdated Show resolved Hide resolved
@stof
Copy link
Member

stof commented Jun 2, 2023

@dmaicher for the url parameter deprecation, I haven an in-progress branch locally fixing it. So maybe you can keep your PR focused on other ones for now

@dmaicher dmaicher force-pushed the fix_deprecations branch 3 times, most recently from 6cf5bc9 to 96ea590 Compare June 2, 2023 14:02
@dmaicher
Copy link
Contributor Author

dmaicher commented Jun 2, 2023

I reported this one on the ORM: doctrine/orm#10744

7x: Doctrine\DBAL\Platforms\AbstractPlatform::usesSequenceEmulatedIdentityColumns is deprecated. (AbstractPlatform.php:3945 called by ClassMetadataFactory.php:622, doctrine/dbal#5513, package doctrine/dbal)

@mpdude
Copy link
Contributor

mpdude commented Jun 2, 2023

For the third item on your list, see #1661

@mpdude
Copy link
Contributor

mpdude commented Jun 2, 2023

Symfony 6.3 for the first time starts collecting Doctrine deprecations as well, so they suddenly get visibility. I expect quite a few those reports in the near future.

@stof
Copy link
Member

stof commented Jun 2, 2023

Due to the testsuite enabling the collection of Doctrine deprecations (due to using symfony/phpunit-bridge 6.3 now), we now detect a bug in doctrine/deprecations itself that breaks our CI: https://github.com/doctrine/DoctrineBundle/actions/runs/5156518808/jobs/9287616881?pr=1667#step:8:29

@dmaicher
Copy link
Contributor Author

dmaicher commented Jun 2, 2023

Is that a bug on doctrine/deprecations?

1) Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection\Compiler\IdGeneratorPassTest::testRepositoryServiceWiring
Undefined array key "file"

/home/runner/work/DoctrineBundle/DoctrineBundle/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:189
/home/runner/work/DoctrineBundle/DoctrineBundle/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:99
/home/runner/work/DoctrineBundle/DoctrineBundle/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/AttributeDriver.php:83
/home/runner/work/DoctrineBundle/DoctrineBundle/vendor/symfony/dependency-injection/ContainerBuilder.php:1109
/home/runner/work/DoctrineBundle/DoctrineBundle/vendor/symfony/dependency-injection/ContainerBuilder.php:1234
/home/runner/work/DoctrineBundle/DoctrineBundle/vendor/symfony/dependency-injection/ContainerBuilder.php:1180
/home/runner/work/DoctrineBundle/DoctrineBundle/vendor/symfony/dependency-injection/ContainerBuilder.php:1657
/home/runner/work/DoctrineBundle/DoctrineBundle/vendor/symfony/dependency-injection/ContainerBuilder.php:1134
/home/runner/work/DoctrineBundle/DoctrineBundle/vendor/symfony/dependency-injection/ContainerBuilder.php:1234
/home/runner/work/DoctrineBundle/DoctrineBundle/vendor/symfony/dependency-injection/ContainerBuilder.php:1180
/home/runner/work/DoctrineBundle/DoctrineBundle/vendor/symfony/dependency-injection/ContainerBuilder.php:1078
/home/runner/work/DoctrineBundle/DoctrineBundle/vendor/symfony/dependency-injection/ContainerBuilder.php:1234
/home/runner/work/DoctrineBundle/DoctrineBundle/vendor/symfony/dependency-injection/ContainerBuilder.php:1180
/home/runner/work/DoctrineBundle/DoctrineBundle/vendor/symfony/dependency-injection/ContainerBuilder.php:1657
/home/runner/work/DoctrineBundle/DoctrineBundle/vendor/symfony/dependency-injection/ContainerBuilder.php:1134
/home/runner/work/DoctrineBundle/DoctrineBundle/vendor/symfony/dependency-injection/ContainerBuilder.php:1234
/home/runner/work/DoctrineBundle/DoctrineBundle/vendor/symfony/dependency-injection/ContainerBuilder.php:1180
/home/runner/work/DoctrineBundle/DoctrineBundle/vendor/symfony/dependency-injection/ContainerBuilder.php:1078
/home/runner/work/DoctrineBundle/DoctrineBundle/vendor/symfony/dependency-injection/ContainerBuilder.php:608
/home/runner/work/DoctrineBundle/DoctrineBundle/vendor/symfony/dependency-injection/ContainerBuilder.php:553
/home/runner/work/DoctrineBundle/DoctrineBundle/Tests/DependencyInjection/Compiler/IdGeneratorPassTest.php:121

file is indeed missing. I get the same error locally. $backtrace[1] only contains

array(3) {
  ["function"]=>
  string(11) "__construct"
  ["class"]=>
  string(43) "Doctrine\ORM\Mapping\Driver\AttributeDriver"
  ["type"]=>
  string(2) "->"
}

@stof
Copy link
Member

stof commented Jun 2, 2023

@dmaicher when the compiled container is not dumped to a cache and then used from there (which is the case in those tests as the stack trace indicates that the ContainerBuilder is used directly as a container in those tests), proxy classes for lazy services are generated through eval.
My guess is that those backtrace frames that don't have a file key correspond to frames happening in the eval'd code.

Copy link
Member

@ostrolucky ostrolucky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be ok merging this to 2.9.x instead, as dev-stability cronjob runs there

@dmaicher
Copy link
Contributor Author

dmaicher commented Jun 4, 2023

Ok I will rebase it on 2.9.x then

@dmaicher dmaicher changed the base branch from 2.10.x to 2.9.x June 4, 2023 11:21
@ostrolucky ostrolucky merged commit dfd468b into doctrine:2.9.x Jun 4, 2023
@dmaicher dmaicher deleted the fix_deprecations branch June 4, 2023 11:23
ostrolucky pushed a commit that referenced this pull request Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

URL connection parameter is deprecated
5 participants