I am updating from 1.9 to 1.10 on top of my D6.28 and I immediately receive this error:

Fatal error: Call to undefined function drupal_strtolower() in /...my...path.../sites/all/modules/securepages/securepages.module on line 219

Line 219 is:
$path = drupal_strtolower(trim($path, '/'));

I haven't modified core and even verified that this function exists in my unicode.inc file. Why isn't the function loaded? I don't understand why this doesn't work.

Help is much appreciated! :-)
Mike

Comments

William Haller’s picture

Also occurs on our site. Reverted to 1.9. The strange thing is drupal_strtolower appears in other modules, although it's possible they aren't in an executed portion. Does just changing it to strtolower do anything for you?

BigMike’s picture

Good to know I am not the only one. I thought about just using strtolower but looking at https://api.drupal.org/api/drupal/includes!unicode.inc/function/drupal_s... there are other parts going on depending on what is sent to the function.

Comparing 1.9 to 1.10, this one line was added, the rest is the same (although "*/autocomplete/*\n*/ajax/*" was removed from the $ignore variable).

Doing some testing now...

BigMike’s picture

Ok, this module is calling that function before the Drupal bootstrap, so the function does not exist.

Solution - at least for now - is to manually invoke unicode.inc by placing a require somewhere above the $path variable, like this:

218:  $ignore = variable_get('securepages_ignore', '');
219:  require_once './includes/unicode.inc';
220:  $path = drupal_strtolower(trim($path, '/'));

Verified this works for me and I completed the site upgrade process without any errors.

BigMike

sterndata’s picture

Will there be another update in the works with corrected code?

William Haller’s picture

Patch works here as well. Thanks.

gordon’s picture

Status: Active » Fixed

This has been fixed in both 2.x and 1.x.

basically the issue is that securepages_match() is called from securepages_boot() which is before unicode.inc is loaded.

gordon’s picture

Status: Fixed » Postponed (maintainer needs more info)

I have added changed to both the dev branches, It would be great if you can test this so I can create new releases.

BigMike’s picture

Confirmed 6.x-1.10+2-dev (2013-Nov-08) works just fine!

BTW I have a question. What is the difference between 6-1.x and 6-2.x? It doesn't list any differences on the main project page. I am only using v1.x because when I first began using Secure Pages there was no 6.x-2.x. Should I upgrade? Benefits? Thanks gordon!

Mike

gordon’s picture

Status: Postponed (maintainer needs more info) » Fixed

Thanks I will release new versions with the fix.

The main difference between 6.x-1.x and 6.x-2.x is that this is some stuff backported from 7.x-1.x

BigMike’s picture

Thank you Sir

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.