By sri20198 on
After upgrading from Drupal 5.2 to 6.14, I ran the update.php. With Privatemsg & Bookmarks module, the update output errors. But when I try to go to the Admin pages, I get the error - Fatal error: Call to undefined function db_num_rows() in /home/sourasht/public_html/test/includes/common.inc(1685) : eval()'d code on line 11.
I have checked for existence of db_num_rows() in the entire Drupal installation directory, but didn't find any. I have also tried removing all the contrib modules, still the same error. I have referred http://drupal.org/node/591684 and http://drupal.org/node/236969, but really don't know where to fix it.
Thanx,
Sridhar
Comments
=-=
when you updated did you first disable all contributed modules?
did you first update all contrib modules to their lastest 5.x version before trying to move to D6 ?
Yes. Infact, i was moving
Yes. Infact, i was moving this site from 4.6.2. So first upgraded from 4.6.2 to 4.7 (including all contrib modules). Then from 4.7 to 5.2 along with all the modules with latest versions. Before i moved from 5.2 to 6.14, I disabled all non-core modules and then run update.php
I'm getting the same error,
I'm getting the same error, and likewise can't find any reference to 'db_num_rows'.
(At least, definitely not in my modules and themes, which I have local copies of - I presume there wouldn't be any references elsewhere in Drupal, but am no expert in searching on my server. The best I could come up with was 'grep -iR 'db_num_rows' *' which didn't return any matches.)
Works well with a clean install & upgrade
I rolled back my site to 5.2 and upgraded to 6.0 instead. Still get the same error - Fatal error: Call to undefined function db_num_rows() in D:\wamp\www\stest\includes\common.inc(1537) : eval()'d code on line 11.
I also installed a new site with Drupal 5.2. Created couple of nodes and then upgraded it to 6.14. It works very well.
So I am looking at this option - install a clean copy of D6 and import all of the content, users, terms, etc from the old site. Is there a module to do this?
That's what I did in the
That's what I did in the first place, and I still have the problem
_
Not sure why, but http://api.drupal.org/api/function/db_num_rows/5 is a function that no longer exists so it would appear you've got an incomplete upgrade hanging around somewhere-- or maybe it's cached. Go into the db and empty (not delete) all the cache* tables.
It's not a caching error - do
It's not a caching error - do you have *any* idea how to diagnose the problem? Is there a debugger to cron, or some other way to see where this function is getting called?
_
The other thing you can do is search all the files of the drupal install for 'db_num_rows'-- first place I would check is common.inc because that's what's mentioned in the error message.
db_num_rows not found in any of the files
I used dreamweaver as well as windows explorer to search for the phrase "db_num_rows" in all of the files in the installation directory. None found. Very annoying.
_
One other thought-- sqldump the db and search that as well. Could be in a custom block or node.
THANX A TON
Yes. It was lurking in one of the blocks. The user who created the block, had used custom code to get some content.
I took a sqldump, searched through it, converted the code to suit 6.x and the site came up.
Thanx a ton WorldFallz.
_
Excellent-- glad we sorted it. But you let users enter code?????
Its a community site and is
Its a community site and is administered by 3 persons from different cities. It was set up on 4.6 and has been running on it for more than 3 years. The db_num_rows code was put in a block long time ago by one of the admins.
Thanx for all the help.
Worked for me too, thanks a
Worked for me too, thanks a bunch
Have tried truncating cache tables
Yes. I have tried that too. I have truncated all cache tables and then tried logging in from another network (even to rule out any cookie / session issues), but no luck.
Incidentally, many have complained with similar errors (not the same though), when moving from D5 to D6 and in response quite a few answered blaming the Forum module. The usual method used has been disable forum module in D5 -> uninstall it in D5 -> copy D6 files & then run update -> then enable Forum module in D6. I would be trying that in some time and will post back if I am successful.