KnpLabs / DoctrineBehaviors

Doctrine2 behavior traits that help handling Blameable, Loggable, Sluggable, SoftDeletable, Uuidable, Timestampable, Translatable, Tree behavior
http://knplabs.com
MIT License
911 stars 287 forks source link

Wrong ClassMetadata #665

Closed ephp closed 2 years ago

ephp commented 2 years ago

Trying use the bundle in SF5 I obtain dtin error in some behaviors

!!
!! Argument 1 passed to Knp\DoctrineBehaviors\ORM\Blameable\BlameableSubscribe
!! r::isBlameable() must be an instance of Doctrine\Common\Persistence\Mapping
!! \ClassMetadata, instance of Doctrine\ORM\Mapping\ClassMetadata given, calle
!! d in /Users/ephraim/Develop/Oltremare/OltremareWeb/vendor/knplabs/doctrine-
!! behaviors/src/ORM/Blameable/BlameableSubscriber.php on line 76
!!

In my project I have

        "name": "doctrine/common",
        "version": "3.1.2",

        "name": "doctrine/dbal",
        "version": "2.13.4",

        "name": "doctrine/doctrine-bundle",
        "version": "2.4.3",

        "name": "doctrine/orm",
        "version": "2.10.1",

I solve in my local replacing

use Doctrine\Common\Persistence\Mapping\ClassMetadata,

with

use Doctrine\ORM\Mapping\ClassMetadata,
TomasVotruba commented 2 years ago

Thank report!

Could you send a failing test case in a pull-request, so we have it covered?

TomasVotruba commented 2 years ago

Closing for lack of feedback. We're narrowing issues to keep focus on active and engaging contributor to keep project growing. Thank you for understanding.

Feel free to re-open with failing test case.