The DB conversion is nearly complete! search.module is the only holdout, and it's weird. But, we can now remove a few more bits of the legacy layer. The attached patch removes two db_result() calls from field.test, leaving search.module as the only place that db_result() is used. We then remove outright db_fetch_array() and db_last_insert_id(). While I was at it I also noticed that db_run_tasks() was incorrectly placed in the legacy group, so it gets moved out of it.
Unfortunately removing the rest of the BC layer, including db_rewrite_sql(), is dependent on getting search.module converted first. As soon as that's done, we can rip out the rest of that nonsense.
Comment | File | Size | Author |
---|---|---|---|
#3 | db-legacy.patch | 6.07 KB | Crell |
#1 | db-legacy.patch | 5.41 KB | Crell |
db-legacy.patch | 6.23 KB | Crell | |
Comments
Comment #1
Crell CreditAttribution: Crell commentedOops, forgot to remove some cruft from the cruft removing patch. :-)
Comment #2
Josh Waihi CreditAttribution: Josh Waihi commentedDo need to explain that.
Also, maybe db_run_tasks should get moved to install.inc as it is only needed during install and updates of Drupal. Confirmed that update does load install.inc (currently on line 707)
Otherwise all good.
Comment #3
Crell CreditAttribution: Crell commentedI could have sworn I did remove that from the second patch. Well, here we go with the function moved to install.inc. Let's see what the bot says.
Comment #4
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks!
Comment #6
jhodgdonThis was never documented in the 6/7 module update guide apparently (see #1021956: db_fetch_array() deprecation is not documented in the 6x. to 7.x module convertion guide, which I am closing as a duplicate of this issue as I reopen this issue).
Comment #7
scor CreditAttribution: scor commentedsubscribe
Comment #8
Crell CreditAttribution: Crell commentedThe upgrade guide already says that the DB layer was gutted and rewritten and includes an example of how to do things the new way. Individually documenting every function that was removed or changed is a waste of time when we already link to the full, detailed, multi-page documentation.
Comment #9
jhodgdonAccording to that other issue:
"Converting 6.x modules to 7.x contains a misleading code snippet featuring db_fetch_array() in Drupal 7 although it's been deprecated. Moreover, this guide does not say how Drupal 6 code using db_fetch_array() should be ported to Drupal 7."
This report is correct.
One d7 example using db_fetch_array is here:
http://drupal.org/update/modules/6/7#custom_block
There is also at least one reference in a D7 example to db_fetch_object(), which is also gone:
http://drupal.org/update/modules/6/7#install-schema
So I would say this wasn't quite fixed.
Comment #10
scor CreditAttribution: scor commentedI understand that documenting every function which was removed is waste of time and it's best to link to new DB layer documentation, however I think that giving a list of deprecated functions might help some people who might not know where to look otherwise. If the deprecated functions are listed, they'll appear in the search results and regular string search, making it obvious it's deprecated and explain why, or at least where to look further. A while back I had to dig out the git log/blame to find out what had happened to
taxonomy_node_get_terms()
, if it had been mentioned in the D6->D7 conversion guide, I found not have wasted so much time. I made sure to update the relevant section of the guide: All taxonomy functions relating to nodes have been removed or refactored.Comment #11
Crell CreditAttribution: Crell commentedRe #9: Those are bugs in the upgrade docs. Whoever wrote those blocks didn't even bother testing them, because those functions were already long gone by that point. That has nothing to do with this issue. I've opened a new issue for those: #1025728: Check module/theme upgrade guides for outdated information
Re #10: A valid point, but again that's a documentation issue in its own right and has nothing whatsoever to do with this issue. Please open a new issue for that. (Or just make the edits. I don't rightly recall all of the removed functions off hand myself, so would have to go do a direct comparison to find them all anyway.)
Disclaimer: Re-opening long-closed issues for only tangentially related separate matters is a pet peeve of mine, as it just makes the queue more cluttered and harder to track. If it were up to me comments would auto-close on any "closed" issues after 2-3 months.