I'm running branch tag 'DRUPAL-6--1' and have seen this on a couple sites when updating content whose type has a pathauto rule. when saving the content I see many warning notices that:

notice: Use of undefined constant PATHAUTO_CASE_LOWER - assumed 'PATHAUTO_CASE_LOWER' in /home/standalone_web/webroot/drupal/bikewinter.org/sites/bikewinter.org/modules/contrib/pathauto/pathauto.inc on line 212.

This warning is repeated many many times. It's distracting if one has notice messages turned on (as my host does) and has them going to the screen (as I do during site dev). It's a simple fix:

< if (variable_get('pathauto_case', PATHAUTO_CASE_LOWER)) {
> if (variable_get('pathauto_case', 'PATHAUTO_CASE_LOWER')) {

or define it as a constant.



swentel’s picture

Status: Active » Needs work
409 bytes

Yeah, this is highly annoying. The constant was introduced in #343851: pathauto_cleanstring() does not convert to lowercase (consolidate all text altering code to pathauto_cleanstring) but is never declared anywhere, also, it's not consistent in the code. If you look in path.admin.inc, the code is using '1' instead of the constant. Attached patch removes the constant and uses '1' again. Let's fix this, it's easy!

swentel’s picture

Status: Needs work » Needs review

changing status

Dave Reid’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

Dave Reid’s picture

Title: pathauto produces lots of 'Use of undefined constant PATHAUTO_CASE_LOWER' warnings » PHP notices: Undefined constant PATHAUTO_CASE_LOWER
greggles’s picture

Status: Reviewed & tested by the community » Fixed


Thanks, guys! (though pardon me, swentel for leaving you out of the commit message - mistake on my part).

From my understanding this is not needed on 6.x-2.x or later since we have real constants there.

Status: Fixed » Closed (fixed)

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