4.6RC1/Pathauto 4.6

* Installed module
* Activated module
* Friendly URL's, Path module activated.
* Settings/Pathauto used to define path according to example, bulk update setting checked
* Saved Setttings

* Return to Settings/Pathauto gives this error:

Fatal error: Call to undefined function: ctype_alnum() in /htdocs/www/modules/pathauto.module on line 250

Deactivating/Deinstalling - Reinstalling/Reactivating module has no effect, error keeps occurring.

Comments

mikeryan’s picture

What version of php are you running? Note that ctype_alnum() is builtin to versions of PHP >= 4.3.0, and Drupal requires PHP 4.3.3 or greater.

jvincher’s picture

Ah, that explains it then. I'm running 4.3.10, have been running Drupal 4.5.2 problem free for months. Forgive my ignorance but has this requirement been added recently?

jvincher’s picture

Err, it's late here. What I meant to say is that I should be okay then.

mikeryan’s picture

Assigned: Unassigned » mikeryan

You've got a sufficient version of PHP - looking at the PHP ctype docs, the only reason I can see that ctype_alnum() wouldn't work would be if PHP on your server had been specifically built with the ctype library disabled (but why would anyone do that?).

mikeryan’s picture

jvincher’s picture

As a follow up, it was a ctype setting in php.ini. My host allows me to change that settings in their account panel so it was easy. Still odd that they had it turned off by default. Anyway, works like a charm now.

olav’s picture

Version: 4.6.x-1.x-dev » 4.7.x-1.x-dev
Priority: Critical » Normal
Status: Closed (fixed) » Needs review

I hade the same problem with missing ctype_alnum in my stock SuSE PHP5.0.3. My fix was to add a replacement function to the top of pathauto.module:

if (!function_exists('ctype_alnum')) {
  function ctype_alnum($text) {
    return !preg_match('/^\w*$/', $text);
  }
}
Thomas Sewell’s picture

If you are using FreeBSD and php5, install the php5-ctype port, i.e. `portinstall -R php5-ctype`.

starbow’s picture

Thanks Thomas, that was a really useful tip!

greggles’s picture

Status: Needs review » Closed (fixed)

It seems it's safe to simply rely on ctype_alnum() being present in the PHP installation rather than creating our own version of the function. If we do create it, I think the better place would be common.inc

owen barton’s picture

With SuSE the package is also named php5-ctype, and can be installed using YAST

greggles’s picture

Component: Code » Documentation
Assigned: mikeryan » greggles
Category: bug » task
Status: Closed (fixed) » Active

Thanks grugnog.

I think we should probably add this to the documentation so that people can find it more easily. I'm marking this as assigned to me and related to documentation to reflect that idea.

greggles’s picture

Status: Active » Fixed

Done: http://drupal.org/node/109904

Thanks grugnog and Thomas Sewell for providing the actual commands/methods to install.

Anonymous’s picture

Status: Fixed » Closed (fixed)
greggles’s picture

for anyone who had this problem I'd appreciate your testing out this alternative: http://drupal.org/node/134473

I don't have this problem so I really appreciate getting other folks to test it.