Drupal 6 Port

mariuss - September 9, 2008 - 03:30
Project:Accents
Version:HEAD
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

Can you please port this module to Drupal 6?

#1

canen - September 22, 2008 - 13:29

I wasn't even aware people were still using this :). I'll port it to 6 put I can't promise when. It is not a difficult module to port, I am just not using Drupal 6 yet and I am not too sure when I'll start.

#2

canen - September 23, 2008 - 01:18

mariuss,

The API that accents uses is actually pretty simple and hasn't changed since it was first release which means the module can be used as is. You'll need to edit the .info file however, due to the changes introduced in 6. The file should now contain:

name = Accents
description = "Removes accents from words before searching"
core = 6.x

I haven't tested it. I'll eventually do an official port but this should work for now.

#3

mariuss - September 23, 2008 - 04:57

Thanks canen, that's good to know.

I did not port the site using Accents to Drupal 6 yet, just checked the upgrade status (using the Upgrade Status module). There are 3 modules in use that have not been ported to Drupal 6, and Accents was one of them.

At least I know Accents is not a blocker :-)

#4

klance - October 16, 2008 - 19:41

I'm including support for Accents in one of my modules, so if you decide to scrap this project, I'd like to bum the function I'm currently including, if u don't mind.

#5

phd_hiren - December 20, 2008 - 08:57

subscribing

#6

soupp - January 19, 2009 - 19:34

The module was absolutely needed and nice for me in D5. But as far as I see D6 deals fine with accents in search (ignores them).

You can check here: http://www.budapestindex.com/

Just enter something say Vasarcsarnok or Hosok in the search box and check highlighted search results for ignored accents / umlauts.

But kudos to canen for making the search magic possible back in D5 anyway!

#7

mgifford - February 3, 2009 - 04:32

subscribe. Would like to see a 6.0 version.

#8

einsteinsboi - February 25, 2009 - 22:37

Attempted a port this module to Drupal 6 using mostly the Coder module. It works on my end, but would like more people to try it out and make sure it's working okay. This is my first port/patch, so be gentle :)

I'm still a newbie at this so I did the info and module file separately and created two patch files. Please do let me know if I did anything goofy, most willing to learn!

thanks all

AttachmentSize
accentsinfofile_patch.patch 387 bytes
accentsmodulefile_patch.patch 13.72 KB

#9

alienbrain - April 6, 2009 - 23:41
Version:5.x-1.0» HEAD

@soupp in #6:

MySQL supports[1] "Collation" algorithm which is a Unicode standard[2] for comparing unicode strings in a predictable manner for users (i.e. it does things similar to what accent module does). So perhaps collation got turned on for you between your D5->6 upgrade.

When the search module finds a word and wants to index it, it inserts it into the search index. When the word already exists, there are 2 possible scenarios:

  • With collation on: MySQL would complain that the word is a duplicate (since the table requires every word to be unique). In Drupal5 the search module is not ready for such rejection from mysql and would just *not* error out (you won't see the error except in the logs probably). This is wrong because the search should have updated the word score in this case. So you need this module in D5 even with collation on. In Drupal6 the search module checks for this case, and if MySQL rejected the INSERT it then updates the search index by increasing the score for the word for the piece of data (e.g. node) it's processing, which is correct. So if you have collation on and Drupal 6 then you probably don't need this module.
  • With collation off: You need this module in Drupal 5 and Drupal 6.

So I definitely think the module should be maintained and moved on. But I suggest that a feature would be added to check for the support of collation on the underlying underlying database. If it exists, then it would suggest to the user that they don't need the module. An easy way to check could be to create a temporary table (both MySQL and PostgreSQL support them) with said collations, INSERT normal and accented versions of some word and if the database rejected the second INSERT then it supports collation, if not, then it doesn't.

[1] http://dev.mysql.com/doc/refman/5.0/en/charset-unicode-sets.html#id2448887
[2] http://www.unicode.org/reports/tr10

#10

inforeto - July 17, 2009 - 01:39

subscribing.
+1 to the feature for detecting collation

#11

rpsu - September 15, 2009 - 12:59

+1

I find it necessary with a couple of sites also.

 
 

Drupal is a registered trademark of Dries Buytaert.