pathauto produces lots of 'Use of undefined constant PATHAUTO_CASE_LOWER' warnings

toddgee - November 8, 2009 - 07:33
Project:Pathauto
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

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:

212c212
< if (variable_get('pathauto_case', PATHAUTO_CASE_LOWER)) {
---
> if (variable_get('pathauto_case', 'PATHAUTO_CASE_LOWER')) {

or define it as a constant.

#1

swentel - December 21, 2009 - 10:13
Status:active» needs work

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!

AttachmentSize
pathauto_undefined_pathauto_case_lower_constant.patch 409 bytes

#2

swentel - December 21, 2009 - 10:13
Status:needs work» needs review

changing status

 
 

Drupal is a registered trademark of Dries Buytaert.