When upgrading my web site from 5.x to 6.x I got the following PHP error :
"PHP Fatal error: Call to undefined function db_num_rows() in html/sites/all/modules/autologout/autologout.module on line 260".
I probably missed something but I don't see what. Could anybody tell me what ?
Thanks for your help.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | autologout6x2-1patchedrefnode362733.zip | 5.85 KB | Leeteq |
| #2 | autologout-1225192-2.patch | 701 bytes | redpuma |
Comments
Comment #1
redpuma commentedWe have the same error too. And we had the same error on the 2.1 version. I found this post
http://drupal.org/node/236969
Is it because db_num_rows() doesn't exist in D6?
Comment #2
redpuma commentedAs I said we tried the 2.1 version and had the same error but on line 264. Site unusable, had to remove module from code base to regain access.
Following the info in the above link we came up with a patch, it works, sorry if its not up to standard but I'm up against a tight deadline.
Comment #3
prunelle commentedThanks Redpuma.
I also saw that it was a known problem for the port from D5 to D6. Does anybody (I don't have the skill and the time yet ...) plan to integrate this patch into the module code ?
Comment #4
Leeteq commentedFor those who cannot patch, here is a working patched 6.x-2.1 version from the patch in #2 above. Havent tested it thoroughly yet, but saving various configurations and enabling it works without errors.
Comment #5
jvandervort commentedFixed in 6.x-2-2
Comment #7
xjessie007 commentedJust a FYI for those who run into this issue.
db_num_rows() is defined in Drupal 4 and 5 in the database.mysql.inc as follows:
http://api.drupal.org/api/function/db_num_rows/4.6
It is not defined in Drupal 6. If you do not mind hacking the code and if you are using MySQL, you can just replace calls to db_num_rows() with PHP core function mysql_num_rows().