module_exists
valcker - September 13, 2006 - 15:05
| Project: | Links Package |
| Version: | HEAD |
| Component: | Code: links.module |
| Category: | support request |
| Priority: | critical |
| Assigned: | valcker |
| Status: | active |
Jump to:
Description
I've downloaded latest links.module from CVS and found that it doesn't work. I'm getting such next error: Fatal error: Call to undefined function: module_exists() in /modules/links/links.module on line 15.
You should change line 15 from "if(module_exists('views')) {" to "if(module_exist('views')) {" and everything will be working :)
Thank you.

#1
Links CVS has been updated to work with the coming Drupal 5.0. See http://drupal.org/node/82088.
So module_exists is the right function call.
#2
Actually, I think you may have the wrong version of Links. If you are running Drupal 4.7, you need the DRUPAL-4-7 branch of Links also. If you are running Drupal HEAD (the 5.0 prerelease version), then you need the HEAD (CVS) version of Links as well.
The module_exist()/module_exists() change is specifically one of the differences in Drupal core between 4.7 and 5.0.
Kind regards,
Syscrusher
#3
Couldn't you make it work for both at once using versioning filters? Or you could use the PHP function_exists function to determine which to call.
Earnie
http://for-my-kids.com
#4
Yes, we could make this one item work in both versions, but there are enough differences in the menu structure between Drupal 4.7 and Drupal 5.0 that we really need the code to be forked, so that's what we did. The DRUPAL-4-7 branch is the right one to download or check out for 4.7, and the DRUPAL-5 branch for 5.x.
Syscrusher