We have to remove the depreciated db_query and replace with \Drupal::database()->query()
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | removing_deprecated_db-2869373-8.patch | 5.07 KB | andypost |
| #8 | interdiff.txt | 2 KB | andypost |
We have to remove the depreciated db_query and replace with \Drupal::database()->query()
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | removing_deprecated_db-2869373-8.patch | 5.07 KB | andypost |
| #8 | interdiff.txt | 2 KB | andypost |
Comments
Comment #2
Pavan B S commentedApplying the patch, please review.
Comment #3
jepster_Thanks for the patch.
However, the usage of \Drupal::database()->query(); violates the dependency injection principle. In /src/AccessStorage.php you can see, that I have injected the database connection, which I have previously declared in the permissions_by_term.services.yml file. Please inject this dependency for executing the queries and test. It would be appreciated if you would provided automated tests. See https://www.drupal.org/docs/8/phpunit/running-phpunit-tests and https://api.drupal.org/api/drupal/core!core.api.php/group/testing/8.2.x.
Comment #4
jeetendrakumar commentedPlease find updated patch file.
Comment #5
jeetendrakumar commentedPlease find updated patch file.
Comment #6
somersoft commentedUpdated the #4 patch file so that it uses the generic Connection class, except for in the test where it creates specific MySQL connection. It now works when SQLite database as well.
Comment #7
andypostThe issue is critical because of
No way to use module with other databases except mysql
should be "The database connection." could be fixed on commit
Comment #8
andypostFixed codestyle nits
Comment #9
jepster_Thanks for reporting and providing the patch. Have you tried PbT in a different DMS than MySQL? Which one?
Comment #10
andypostSure, that's why I reported and fixed patch - I'm using sqlite a lot.
Imo patch is straightforward and tested.
Comment #12
jepster_Thanks for reporting and the provided patch! I have polished it a bit and integrated into release 8.x-1.21.