Every time I go to type in this function I spell it module_exists and cause a big old parse error. Why?

1. module_exists is proper English.
2. It also mirrors the PHP function function_exists.

Patch renames throughout core, and as an extra added bonus, provides the original module_exist function in legacy.module if you are so inclined.

Please, for webchick's already failing sanity, +1. ;)

CommentFileSizeAuthor
#6 module_exists_0.patch22.76 KBwebchick
module_exists.patch23.17 KBwebchick
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dman’s picture

Ditto ditto ditto.

seandunaway’s picture

+1 cause webchick told me to

chx’s picture

Priority: Normal » Critical
Status: Needs review » Reviewed & tested by the community

Those two reasons webchick mentioned. Setting to critical because I just can't stand another release with this.

eaton’s picture

nice use of legacy module!

+1. Booyah.

dww’s picture

+100, because this is a beautiful thing. webchick didn't have to tell me to say it. ;)

this is a nice touch in legacy.module:

+ * This function is identical to module_exists, but is provided for backwards
+ * compatibility.
...
+function module_exist($module) {
+  $list = module_list();
+  return array_key_exists($module, $list);
+}

anyway, definitely a good move, definitely RTBC. ;)

webchick’s picture

FileSize
22.76 KB

And just in case Dries or whomever is NOT so inclined, here is the same patch without the legacy.module inclusion. Take your pick. :)

flk’s picture

Status: Reviewed & tested by the community » Active

hell yes +1

keep making the same ol mistake of exists rather than exist

eaton’s picture

Priority: Critical » Normal
Status: Active » Reviewed & tested by the community

Probably not really an appropriate use of critical, as things work fine without it. But it's a persistent, long-term misspelling that makes checking modules counter-intuitive. Just because it's not critical doesn't mean that this typo in a key core function doesn't make baby Jesus cry.

gordon’s picture

+1, Also there are a lot of other php functions that use exists vs exist

see http://www.php.net/manual-lookup.php?pattern=exists&lang=en to see more like file_exists(), class_exists(), ...

Steven’s picture

Status: Reviewed & tested by the community » Fixed

Good catch. Committed to HEAD.

I don't really like the legacy.module part though... modules need to be updated for 4.8 anyway, and it's a search-and-replace change that is easily documented.

webchick’s picture

Documented @ http://drupal.org/node/64279. Thanks so much!

Anonymous’s picture

Status: Fixed » Closed (fixed)