This occurs after updating user's profile data. If I search for a keyword that I just added to a profile, the ProfilePlus module displays both the old (pre-update) & new user objects. Please take a look at the screenshot I've provided. The first result shows the user's account before I added extra profile data the second is the updated one with the new profile data included. This is reproducible. If this issue isn't clear, please let me know.

Comments

davemybes’s picture

If you clear your cache tables (all of them), does this solve the issue? I am not suggesting this as a real solution, but rather as a way to find where the problem is.

peterd12’s picture

This doesn't solve the issue. It provides the same results after clearing. Once I'm done a module I'm working on I should be able to take a look at it and possibly submit a patch.

davemybes’s picture

OK, thanks for testing that. I'll take a look at the module in the next few days.

peterd12’s picture

Status: Active » Needs review
StatusFileSize
new1.28 KB

incrn8, this should fix the problem that was occurring. A new item was being added to the $find array for each profile category, producing multiple results for the same user. This ensures that only one item is added to $find for each user.

peterd12’s picture

StatusFileSize
new964 bytes

Oops, that patch was applied to a slightly older version of the profileplus module. This should be the correct one.

davemybes’s picture

Nice. I'll take it for a test run and see what happens. Thanks.

davemybes’s picture

Peter,

I just tested your issue (without the patch) on my system and I don't get that double result problem. I created new profile fields, changed them, created new users, modified their profile data too, but I always got only the one result for each user. Could you send me step-by-step instruction on exactly what you did. Include the details of the profile field (category, title, etc). I'll do exactly what you did and see what happens.

Does this occur with an unmodified Garland theme too?

frerin’s picture

I get the same problem here, too. I am using Drupal 5.1, Garland.
Without the patch I will get the results twice, with the patch I get the results three times.

peterd12’s picture

OK, I just tried it with a fresh db and fresh install, so here's the step by step method to reproduce it (with the default Garland theme enabled):

1. Download & install http://ftp.drupal.org/files/projects/drupal-5.x-dev.tar.gz with a new MySQL db.
2. Enable and set up permissions for authenticated users to access the search, profile, and profileplus modules.
3. Create a user (e.g. test_user) with two profile fields each in their own categories.
4. Log in as that user and update one of the two profile fields with some data.
5. Search with some of that data at /?q=search/profile/profile and note only one result.
6. Update the second profile field with some data.
7. Search with some of the second field's data at /?q=search/profile/profile and note two results; the profile with the first update, and the profile with the second update.

frerin: Werid, with the fresh install and no other modules enabled, the patch fixes the results for me and only shows one user.

peterd12’s picture

The profile fields and categories can be any names for this to happen. I used categories Personal info and Contact info and fields profile_blurb (personal) and profile_location (contact.)

davemybes’s picture

Assigned: Unassigned » davemybes
Status: Needs review » Reviewed & tested by the community

@peterd12,

Your patch appears to work fine. I followed your steps and saw the issue - even for admin. With the patch (actually just the one line where the $find[] line is moved outside the second foreach loop), the issue is gone.

I'm marking this as RTBC, but will hold off a bit until we can figure out frerin's issue.

@frerin: do you get the same problem on a clean install of Drupal 5.1 with a fresh download of the profileplus module?

peterd12’s picture

Glad I could be of help. frerin: are you sure you applied the patch properly? If applied improperly (ie. a duplicate $find[] line added inside the for-loop) you would see three results.

totaldrupal’s picture

I have tried Profile Plus on two site, 5.1 and 5.2. Both sites give me multiple results. It appears to me that how many times the profile is duplicated is related to the amount of fields you have in the profile.

Will your patch fix this? If so how do I apply it? I'm not a programmer, your assistance is appreciated.

davemybes’s picture

This should be fixed in the latest release of the module.

davemybes’s picture

Status: Reviewed & tested by the community » Fixed

This issue IS fixed in the latest dev version.

Anonymous’s picture

Status: Fixed » Closed (fixed)