See #2848161: [meta] Replace calls to deprecated db_*() wrappers
Marking as Novice as all these functions have no usage in core anymore, and writing a single patch similar to #2994556: Properly deprecate db_and, db_condition, db_or, db_xor will do the job here.
Find existing references in code to these functions:
find . -type f \( -name '*.inc' -or -name '*.module' -or -name '*.php' \) -exec grep -E "db_driver|db_escape_field|db_escape_table|db_rename_table|db_drop_index|db_drop_unique_key|db_add_unique_key|db_drop_primary_key|db_add_primary_key" {} \+
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | interdiff-12-14.txt | 8.37 KB | mitrpaka |
| #14 | deprecate_db_wrappers-2994694-14.patch | 13.08 KB | mitrpaka |
Comments
Comment #2
mondrakeUsing the grep statement in IS, this is the current situation:
So there are a couple of comments in Schema.php and TableSortExtender.php to be fixed, too.
Comment #3
hardikpandya commentedComment #4
hardikpandya commentedComment #5
longwaveThis looks pretty good, but I think each deprecation needs tests adding in DatabaseLegacyTest.
This is not right:
escapeTable()belongs to the database and not the schema, but as this is just a documentation reference rather than a code example, it is probably better overall to say\Drupal\Core\Database\Connection::escapeTable()here.Comment #6
hardik rawal commentedComment #7
hardik rawal commentedComment #8
mondrakeComment #9
mondrakeNW to add tests as per #5.
Comment #10
mitrpaka commentedTests added.
Comment #11
mondrakePls remove the final dot from the message string, see #2848137-66: Replace all calls to db_update, which is deprecated, also in the other methods and the corresponding tests,
assertNotNull, the function returns a stringsame
same
it's sufficient to
assertFalseon dropping a non-existent indexComment #12
Vidushi Mehta commentedRerolled #10 as the patch does not apply and with the changes mentioned by #11.
Comment #13
mondrakejust:
Please add interdiffs when posting new patches on top of previous ones.
Comment #14
mitrpaka commentedComment #15
mondrakeLGTM, thank you
Comment #17
catchThe patch was changing permissions on the files, but fixed this on commit. Thanks!
Comment #18
andypostFiled follow-up #2996436: Follow-up to fix DatabaseLegacyTest::testDbRenameTable to fix broken tests on sqlite/pgsql