Hi,

Finally I thought I found the right autocomplete.. just something in CCK that offers matches in the same field.

So I added it in a content type, created a test field country and went on to create its first node. In that field I typed "Czechoslovakia" and saved it. Then created another node and I expected that the country field would autocomplete from "Czec" to that country's name. However, nothing happens, the search wheel keeps spinning forever.

Is there a bug, if so, can you supply a solution? I need this real quick.. hope you are there and can look at it as soon as possible.

Thanks,

Tomas

CommentFileSizeAuthor
#3 textfield_autocomplete.module.patch828 bytesAnonymous (not verified)

Comments

Anonymous’s picture

Same problem found here.

You will need PHP5 in order to get this to work.
It is caused by the call to array_combine function on line 165.

If you are on PHP4 then change the following piece of code:

    while ($row = db_fetch_array($result)) {
      foreach ($row as $colname => $colval) {
        $items[] = $colval;
      } // foreach col value
    } // while there's rows
  } // foreach table

  if ($items) { $items = array_combine($items, $items); } 

to this:

    while ($row = db_fetch_array($result)) {
      foreach ($row as $colname => $colval) {
        $items[$colval] = $colval;
      } // foreach col value
    } // while there's rows
  } // foreach table

  //if ($items) { $items = array_combine($items, $items); } 

Joep

vacilando’s picture

Thanks for the suggestion but.. no, I am on PHP v5.2.2

Any other ideas?

Tomas

Anonymous’s picture

Title: Does not autocomplete » Patch to make it php4 compatible
StatusFileSize
new828 bytes

This the patch for my previous comment (#1)
It is my first Drupal patch ever so I hope it is in the right format.

Anonymous’s picture

Status: Active » Needs review

Change the status

vacilando’s picture

Wow, joepH -- that worked! You can roll out a new release based on the patched code. Thanks!

Just to remind you, I needed this patch even though I am on PHP 5.2.2 (so this thread's title is a bit misleading).

Tomáš

Anonymous’s picture

I have no idea how to create a new version. I am not the module maintainer.

vacilando’s picture

Category: support » bug
Status: Needs review » Reviewed & tested by the community

JoepH, you are of course correct. Hopefully linuxbox is reading this and will apply this patch as soon as possible and roll out a new version.

salvis’s picture

I also need this patch on PHP 4.4.0, and it works fine.