-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Timestampable (and maybe more extensions) don't work with DBAL 4.0.0-RC2 #2752
Comments
DBAL 4.0 isn't supported right now and probably won't be for a while (IIRC ORM 2.x isn't getting support for it, so ORM 3.x compat has to be sorted out first). |
The solution is actually to use the high-level API to access the platform (which has not change between 3.x and 4.x) instead of reaching for the low-level driver. |
It seems the Symfony 7 generator uses DBAL 4.0, this "bug" will annoy many people (I'm one of them ;)). |
Note that the Symfony generator should be forcing DBAL 3.x for now since a few days. |
Hi folks, I've installed Doctrine manually into a Laravel application and I'm experiencing the same problem.
@mbabker is there a roadmap I could look at? Failing that, do you have any idea when DBAL 4.x will be implemented? I'll build a workaround for my particular scenario. |
As this package is entirely supported by volunteers, there's no roadmap or timeline. But, the gist of what's required is basically to finish ORM 3 compat (as ORM 2 and DBAL 4 are not usable together, so there's nothing that can really be done to test this at the moment) then start working on DBAL 4 compatibility. The fix noted in #2752 (comment) (basically changing any calls similar to |
I also just ran into this issue - it would be helpful to make a note what the extension is and is not compatible with in the README.md so people don't get started with the extension only to run into the same error (especially if the incompatibility issue 2502 is almost 2 years old) fwiw @Arkanii I was able to get the Timestampable annotation working with your change and one other - here's a composer patch file, maybe it'll help somebody out. |
The best place to look at compatibility is going to be the
And as that issue shows, there's actually a patch that can help fix that particular compatibility issue from a pure code perspective. Except it's not easy to ship it because the changes require data migrations for downstream users (the DBAL's object and array types store data using PHP's
A pull request for the first change in that patch would be hugely appreciated instead of just patching your local app. As for the second change, a proper fix has already landed in this repository, so it's not necessary with the latest release. |
@nbennett25 but still, it needs fixing :| |
Is it planned to update dbal > 4.0.0 in the upcoming release? |
any progress ? |
Environment
Package
show
Doctrine packages
show
PHP version
Subject
With DBAL 4.0.0-RC2, there is a bug with Timestampable.
I found why and I can provide a fix, but I think this bug can be on other extensions... That's why I only create a bug issue.
In DBAL 4.0.0-RC2, the method
$this->getObjectManager()->getConnection()->getDriver()->getDatabasePlatform()
now wait an argument, which is not provided for the moment, and thegetFieldMapping
function return an object instead of an array.I found the bug in the
src/Timestampable/Mapping/Event/Adapter/ORM.php
file.Actual version :
show
Fixed version :
show
This fix work on my side.
I'll be happy to help if needed !
Minimal repository with the bug
I'll do it if I have some free time, I apologize to haven't created it for now.
Steps to reproduce
Just create a project that use DBAL 4.0.0-RC2 instead of 3.x.x and use Timestampable on a updated_at property and try to save a entity.
Expected results
Actual results
"Too few arguments to function Doctrine\\DBAL\\Driver\\Middleware\\AbstractDriverMiddleware::getDatabasePlatform(), 0 passed in /app/vendor/gedmo/doctrine-extensions/src/Timestampable/Mapping/Event/Adapter/ORM.php on line 33 and exactly 1 expected"
Thanks ! 😄
The text was updated successfully, but these errors were encountered: