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

Add possibility to set reportFieldsWhereDeclared in ORMSetup #10865

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

W0rma
Copy link
Contributor

@W0rma W0rma commented Aug 2, 2023

The parameter $reportFieldsWhereDeclared was introduced to the AttributeDriver in #10455 and setting it to false is deprecated.

However, ORMSetup::createAttributeMetadataConfiguration() doesn't provide a way to fix this warning:

DEPRECATION: 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. (AttributeDriver.php:82 called by ORMSetup.php:107, https://github.com/doctrine/orm/pull/10455, package doctrine/orm) /var/www/html/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:209

Otherwise it is impossible to avoid a deprecation warning when using ORMSetup::createAttributeMetadataConfiguration()
@derrabus derrabus added the Bug label Aug 2, 2023
@derrabus derrabus added this to the 2.16.1 milestone Aug 2, 2023
@derrabus
Copy link
Member

derrabus commented Aug 2, 2023

Thank you. I agree that we should treat this as a bugfix. @mpdude WDYT?

@mpdude
Copy link
Contributor

mpdude commented Aug 2, 2023

Agree.

Seems I added the flag in \Doctrine\ORM\ORMSetup::createDefaultAnnotationDriver(), but missed that method below.

@derrabus derrabus merged commit fd0bdc6 into doctrine:2.16.x Aug 2, 2023
42 checks passed
derrabus added a commit that referenced this pull request Aug 7, 2023
* 2.16.x:
  Turn identity map collisions from exception to deprecation notice (#10878)
  Add possibility to set reportFieldsWhereDeclared to true in ORMSetup (#10865)
  Fix UnitOfWork->originalEntityData is missing not-modified collections after computeChangeSet  (#9301)
  Add an UPGRADE notice about the potential changes in commit order (#10866)
  Update branch metadata (#10862)
nicolas-grekas pushed a commit to nicolas-grekas/doctrine-orm that referenced this pull request Aug 7, 2023
…octrine#10865)

Otherwise it is impossible to avoid a deprecation warning when using ORMSetup::createAttributeMetadataConfiguration()
@W0rma W0rma deleted the fix-deprecation-attribute-driver branch April 29, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants