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.

CommentFileSizeAuthor
#3 db-legacy.patch6.07 KBCrell
#1 db-legacy.patch5.41 KBCrell
db-legacy.patch6.23 KBCrell
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Crell’s picture

Issue tags: +Quick fix
FileSize
5.41 KB

Oops, forgot to remove some cruft from the cruft removing patch. :-)

Josh Waihi’s picture

Status: Needs review » Needs work
Issue tags: -Quick fix
-  # RewriteBase /
+  RewriteBase /~lgarfiel/projects/drupal7

Do 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.

Crell’s picture

Status: Needs work » Needs review
FileSize
6.07 KB

I 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.

Dries’s picture

Status: Needs review » Fixed

Committed to CVS HEAD. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jhodgdon’s picture

Status: Closed (fixed) » Needs work
Issue tags: +Needs documentation updates

This 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).

scor’s picture

subscribe

Crell’s picture

Status: Needs work » Closed (fixed)

The 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.

jhodgdon’s picture

Status: Closed (fixed) » Needs work

According 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.

scor’s picture

I 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.

Crell’s picture

Status: Needs work » Closed (fixed)

Re #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.