I just did some research to see if there were any Drupal users who work for the music company EMI. Here's the list I found: http://drupal.org/profile/companies/EMI

When I started clicking on profiles, looking to confirm these people had worked for EMI I could not find the company listed in several people's profile.

I suspected EMI might be picking up a sub-string of company names. So I tried: http://drupal.org/profile/companies/EM and I got a list of people. I then tried http://drupal.org/profile/companies/EMIT and got none.

Could someone take a look at this and see if this profile listing is broken?

Comments

bonobo’s picture

It doesn't appear to, at least in the case of http://drupal.org/profile/companies/EM

All these users have worked for "EM" -- and this is a small subset:

http://drupal.org/user/22202
http://drupal.org/user/75555
http://drupal.org/user/77320
http://drupal.org/user/26398

Except that none of them have -- a lot of false positives.

And on a related note, this profile (http://drupal.org/user/75555) shows how easy it is to break this functionality.

oadaeh’s picture

The search is finding case insensitive substrings within strings. So in bonobo's first example, "EM" is found within the name of a company listed there. (I'm not providing unnecessary credit. You can click the link and see.)

The same is true for the EMI search.

catch’s picture

Title: Does people who have worked for, actually work? » Profile generated urls are inconsistent
Project: Drupal.org site moderators » Drupal core
Version: » 7.x-dev
Component: User account problem » profile.module

Core bug.

R.Muilwijk’s picture

I do not think this is still a bug. The code in core is like this:

    // Determine what query to use:
    $arguments = array($field->fid);
    switch ($field->type) {
      case 'checkbox':
        $query->condition('v.value', 1);
        break;
      case 'textfield':
      case 'selection':
        $query->condition('v.value', $value);
        break;
      case 'list':
        $query->condition('v.value', '%' . db_like($value) . '%', 'LIKE');
        break;
      default:
        drupal_not_found();
        return;
    }

So as long as you don't use a list it should look for a exact match. This issue could however be used to add descriptions to the different types on the profile fields page. So is this just by design or are we going to make a change in documentation or code?