Comments (7)
I don't know what make:migration
does under the hood, but without a full stack trace pointing to what annotation(s) from what file(s) are trying to be read, it's hard to do anything but point to random GitHub repositories or random commits that have nothing to do with this specific error.
For the folks hitting that annotation-related error when having gedmo/doctrine-extensions
installed at a minimum (whether that be your application added it explicitly or you're using StofDoctrineExtensionsBundle
which integrates that library), the technical reason for it is that when an annotation or attribute reader is not explicitly injected into the extensions library's Doctrine event listeners, it will default to creating a generic Doctrine\Common\Annotations\AnnotationReader
instance if the doctrine/annotations
library is installed, and only attempts to create an attribute reader if running PHP 8 and the annotations library is not installed. The extensions library knows nothing about whether it's running inside a Symfony 7 application or in some other application integrating one of the Doctrine object managers, so it can't just magically change behaviors because of a framework being present.
For folks getting any kind of [Semantical Error] The class "Doctrine\ORM\Mapping\*" is not annotated with @Annotation.
error, this generally means that you are running ORM 3.x (which dropped support for annotations) and something in your application is still parsing annotations. Whether that be through explicit configuration or some kind of fallback behavior (like the one I've described in the extensions library) is hard to say, but that is ultimately the reason for it, and this probably indicates that you're trying to use dependencies at versions that are not compatible with one another.
The symfony/symfony#48792 issue is specific to the Symfony DependencyInjection component and its handling of the older @required
annotation alongside the newer #[Required]
attribute; the fix for it is not a one-size-fits-all solution for every PHP file that has both annotations and attributes. So shooting off PRs that remove the annotations is just not going to be helpful as doing so will break backward compatibility for downstream users relying on annotation-based configuration.
from reset-password-bundle.
Hi @jrushlow.
The issue occurs for me with Symfony 6.4 while using the Stof DoctrineExtensions. As soon as I add this to my stof_doctrine_extensions.yaml, the same error occurs.
stof_doctrine_extensions:
default_locale: en_US
orm:
default:
loggable: true
There is an issue for this error on their project as well, but I'm not certain what causes this error: stof/StofDoctrineExtensionsBundle#470
Edit 1: Seems like the DoctrineExtensions isn't ready to be used with Doctrine 3 yet. As I haven't had issues with the RestPasswordBundle until I've added the DoctrineExtensions, the error message most likely displays an confusing text.
Edit 2: Downgrading doctrine/orm from 3.1.* to 2.19.* fixed this issue. It's a none issue for the RestPasswordBundle, but might be worth a notice for future reference, until DoctrineExtensions are ready for Doctrine 3.
from reset-password-bundle.
Sure thing @jrushlow, here are the links.
composer.json: https://gist.github.com/KhorneHoly/4b88b1a066d494195adff309bb246ad5
composer.lock: https://gist.github.com/KhorneHoly/3a94d7383014fdabe408ad3beb6bcd14
from reset-password-bundle.
@xribant - I'm not able to reproduce this error on a fresh symfony install. Can you provide:
- the exact steps used to create the new symfony 7 app
- your
composer.json
- at the very least therequire
&&require-dev
sections of the file - the contents of
config/packages/doctrine.yaml
- specifically thedoctrine.orm
configuration
I would suspect this is caused by the doctrine config being set to use annotations
rather than attributes.
When I do:
symfony new --webapp --docker ./app-test-287
bin/console make:user
(Yes to defaults)bin/console make:reset-password
(Yes to defaults)bin/console make:migration
I'm getting a success message with a generated migration file.
from reset-password-bundle.
Howdy @KhorneHoly - can you create a gist of your composer.json
&& composer.lock
file for me (when the error occurred)? I'd like to dig into this a bit more, but I don't have much to go on in order to reproduce the error.
from reset-password-bundle.
I faced the same now.
To be noted for this bundle developers(and all other bundle developers as well)
I found the solution here: symfony/symfony#48792
Solution:: remove double required annotation + attributes
from reset-password-bundle.
So shooting off PRs that remove the annotations is just not going to be helpful as doing so will break backward compatibility for downstream users relying on annotation-based configuration.
You are right.
from reset-password-bundle.
Related Issues (20)
- Null Error during migration step HOT 3
- Some mandatory parameters are missing ("token") to generate a URL for route "app_reset_password". HOT 5
- Cannot find the entity manager for class "App\Entity\ResetPasswordRequest" HOT 2
- Token verification may fail for DateTime instances with milliseconds resolution
- Emails not send if use MailerInterface in private method proccessSendingResetEmail HOT 1
- Request: Allow to pass lifetime parameter in generateResetToken function on v1.14.1 version HOT 2
- Get not hashed token for functional testing HOT 2
- Errors after installation HOT 1
- Cannot find the entity manager for class "App\Entity\ResetPasswordRequest" HOT 6
- Error 500 when open url from Gmail or 365 web client HOT 3
- Support Symfony 7 HOT 3
- Flash message in request.html.twig HOT 2
- Email not send . SendGrid , JWT Autentication, API Platfrom HOT 4
- ResetPasswordBundle v2.0
- ControllerTrait clear token HOT 2
- New password validaition constraints HOT 1
- [2.x] add test to ensure if lifetime is changed in userland - the new value is used in the helper
- [2.x] [tests] implement a solution to run `make:reset-password` command in tests
- Subject: How to Disable forgot-password Routes in ReDoc Documentation Only?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reset-password-bundle.