Function m() creates issues with ubercart

jhodgdon - April 17, 2009 - 20:41
Project:Porter-Stemmer
Version:6.x-1.0
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

There are quite a few functions in porterstemmer.module that lack the porterstemmer_ prefix on their function names.

According to Drupal coding standards (http://drupal.org/coding-standards) they should all be prefixed with the module name (see the Naming Conventions section, about half-way down the page). You might also want to use the prefix _porterstemmer_ for internal-use-only function, to make absolutely sure they won't be mistaken for hook functions. (The location module had this problem with a function named location_diff, which made a conflict with hook_diff in the diff module.)

#1

greggles - April 18, 2009 - 13:43
Status:active» postponed (maintainer needs more info)

Much of this code is based on work from elsewhere so it is left in the original format to make it easy to merge in updates from the outside code.

Is there a specific problem occurring now or is this just a best practice.

#2

jhodgdon - April 20, 2009 - 15:02

It's an official Drupal coding standards best practice...

I didn't experience any difficulty, but some of those function names are pretty scary. I was especially worried by the funtion called "replace", eek! Maybe the upstream maintainers could be convinced to put some kind of a prefix on all of their functions?

Anyway, feel free to ignore. The code scared me, but I haven't experienced any specific problems.

#3

jhodgdon - July 14, 2009 - 23:40
Status:postponed (maintainer needs more info)» fixed

This is now fixed in the HEAD branch. See commit http://drupal.org/cvs?commit=237490

#4

manishnamdeo - July 22, 2009 - 06:23
Title:Function names should be prefixed» Function m() creates issues with ubercart
Priority:normal» critical
Status:fixed» active

Function m() creates issues with ubercart when using cybersource because m() function is already defined in HOP.php.
Renaming m() to mCount() in porterstemmer.module resolves the issue.

#5

greggles - July 22, 2009 - 14:29

I think #511930: Upgrade to Porter 2 algorithm is a better way to solve this.

#6

jhodgdon - July 22, 2009 - 15:04
Status:active» fixed

Yes. We'd really appreciate it if you could test the development version of Porter Stemmer, as detailed on that page. As soon as a few people test it successfully, it will become the next release. Thanks!

So I am marking this issue back to "fixed", since the fix has been checked in.

#7

System Message - August 5, 2009 - 15:10
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.