A semantic error occurs when using the #[Translatable] attribute in an entity.
Previous behavior
All goes well.
No error is displayed.
Current behavior
The following error is displayed:
In AnnotationException.php line 36:
[Semantical Error] The class "Doctrine\ORM\Mapping\MappedSuperclass" is not annotated with @Annotation.
Are you sure this class can be used as annotation?
If so, then you need to add @Annotation to the _class_ doc comment of "Doctrine\ORM\Mapping\MappedSuperclass".
If it is indeed no annotation, then you need to add @IgnoreAnnotation("ORM\MappedSuperclass") to the _class_ doc comment of class Gedmo\Translatable\Entity\MappedSuperclass\AbstractTranslation.
make:migration [--formatted] [--configuration [CONFIGURATION]]
How to reproduce
After installing stof/doctrine-extensions-bundle
composer require stof/doctrine-extensions-bundle
And made the following changes to the project:
doctrine.yaml
doctrine:
dbal:
...
orm:
...
mappings:
App:
...
gedmo_translatable:
type: attribute
prefix: Gedmo\Translatable\Entity
dir: "%kernel.project_dir%/vendor/gedmo/doctrine-extensions/src/Translatable/Entity"
alias: GedmoTranslatable # (optional) it will default to the name set for the mapping
is_bundle: false
...
TheEntity.php
<?php
namespace App\Entity;
...
use Gedmo\Mapping\Annotation\Translatable;
...
class TheEntity
{
...
#[Translatable]
private string $title = '';
...
}
And then makes a:
php bin/console make:migration
The following error is displayed:
In AnnotationException.php line 36:
[Semantical Error] The class "Doctrine\ORM\Mapping\MappedSuperclass" is not annotated with @Annotation.
Are you sure this class can be used as annotation?
If so, then you need to add @Annotation to the _class_ doc comment of "Doctrine\ORM\Mapping\MappedSuperclass".
If it is indeed no annotation, then you need to add @IgnoreAnnotation("ORM\MappedSuperclass") to the _class_ doc comment of class Gedmo\Translatable\Entity\MappedSuperclass\AbstractTranslation.
make:migration [--formatted] [--configuration [CONFIGURATION]]
This is my first issue.
If I've made any mistakes in this one, I apologize.
BC Break Report
Summary
A semantic error occurs when using the #[Translatable] attribute in an entity.
Previous behavior
All goes well. No error is displayed.
Current behavior
The following error is displayed:
How to reproduce
After installing stof/doctrine-extensions-bundle
And made the following changes to the project:
doctrine.yaml
TheEntity.php
And then makes a:
The following error is displayed: