After several days of investigation and lots of different attempts to fix this I am at the end of my abilities here. I've been trying to upgrade a 4.7.5 site to 5.0. I've followed all the steps but no matter what I've done I keep getting this error:

Fatal error: Call to undefined function module_exist() in /htdocs/mysite/includes/common.inc(1342) : eval()'d code on line 2

Where am I going wrong?

Thanks.

Comments

hectorplus’s picture

Could be that one of your modules are not drupal 5 compatible. Try disabling one by one, till the error goes away.
Just trying to help. I have been thru so many errores too, its been fun, annoying, stressful...at the end, things pay off.

Tecito.com
Comunidad Latina en Canada, regístrate ya! Join the growing latin community in Canada.

genemcc’s picture

Thanks hectr. I don't think that's it because I've turned off all but core before moving to 5.0. I'll keep looking

John98’s picture

After several days of investigation and lots of different attempts to fix this I am at the end of my abilities here. I've been trying to upgrade a 4.7.5 site to 5.0. I've followed all the steps but no matter what I've done I keep getting this error:

Fatal error: Call to undefined function module_exist() in /htdocs/mysite/includes/common.inc(1342) : eval()'d code on line 2
. . . . . . . .

Where am I going wrong?

heine’s picture

heine’s picture

You need to update a php snippet in either:

- a node
- a custom block
- a block visibility setting

Modify module_exist to read module_exists.
--
The Manual | Troubleshooting FAQ | Tips for posting | How to report a security issue.

genemcc’s picture

Thanks Heine. Where do I look for the PHP snippets? Are they part of the database? I've looked in the directories but everything there is from the 5.0 release.

heine’s picture

You can find php posts, blocks and block visibility settings by executing the following queries (SQL tab in phpmyadmin).

PHP posts:

SELECT n.nid, n.title FROM node n INNER JOIN node_revisions r ON n.vid = r.vid WHERE r.format = 2;

Custom PHP blocks:

SELECT * FROM boxes WHERE format = 2;

Block visibility settings:

SELECT * FROM blocks WHERE visibility = 2 AND status = 1;

--
The Manual | Troubleshooting FAQ | Tips for posting | How to report a security issue.

genemcc’s picture

Wow! Many many thanks! I'll give that a try and report back. There's always more to learn!!! LOL

genemcc’s picture

Heine, you're a genius! Looks like we have a winner. It appears that the Google Adsense module used module_exist instead of module_exists. As soon as I can get access to my test server I'll see if that solves the issue.

This raises a new question, though. If the Adsense module was deactivated before making the conversion why is this even an issue? I would think that deactivated modules would not be an issue, hence the warning to deactivate non-core modules in the upgrade instructions.

Anyway, thanks again!

bdillahu’s picture

I found a couple old Google Adsense blocks I had manually created before the adsense module did it for you...

I agree... I wonder why a deactivated block still causes problems... these were "off" so I figured they didn't relate and hadn't even looked in the code.

Thanks for the SQL snippets!!!

Bruce

genemcc’s picture

Just checking in to let you know that the Google Adsense issue was, indeed, the problem. Thanks again for your help!

adminfor@inforo.com.ar’s picture

Tried and solved module_exist issue, but still not working... same error
Fatal error: Call to undefined function: module_exist() in ...... /includes/common.inc(1342) : eval()'d code on line 2

Nevertheless, I tried Heine's queries in this way filtering only module_exist

SELECT * FROM node_revisions WHERE body like '%module_exist%';
SELECT * FROM boxes WHERE body like '%module_exist%';
dgnova3’s picture

I had a similar problem installing 5.1. All non-core modules were turned off. I had to search the database in the search tabd of myphpadmin. The OG module (organic groups) had 3 instances of the old spelling which had to be edited. Perhaps if I had installed the new OG before encountering this error it would have also resolved this but I did not try that.

micheleannj’s picture

I was having problems with our custom code calling modules I'd turned off... I'd never figured out how to fix it in the db. Thanks so much for your post!

ff1’s picture

It doesn't matter what the problem is... there is always someone on drupal.org who knows the solution.

Many thanks!

ian
http://fantasyformula1.uni.cc