Discovered by @fod:

If an animal has more than one ID tag on it, it will appear duplicated in the animals list.

This is because the View that generates the animals list includes a relationship to the ID tag, so that it can provide filter and sort options.

The easy solution would be to remove the relationship and filter+sort options, but that means it will no longer be possible to filter/sort by ID tag.

Comments

m.stenta created an issue. See original summary.

m.stenta’s picture

Issue summary: View changes
m.stenta’s picture

Looking at this again... it appears that there is an option on the relationship handler to force it to only join in the FIRST id tag on each animal. This would fix the duplicates, but it means that sort/filter would only work on the FIRST id tag on the animal.

This is annoying, but I think it's the best way to solve the duplicate issue without also losing the ability to sort/filter.

  • m.stenta committed dff5e21 on 7.x-1.x
    Issue #2707083: Animals with more than one ID tag are duplicated in...
m.stenta’s picture

Status: Active » Closed (fixed)

I went with the approach in comment #3 above.

The ID tag relationship is now only joining to the FIRST id tag on the animal. I also added a description to the ID filter to describe that this limitation exists: "If there are multiple ID tags on an animal, this filter will only look at the first one."

m.stenta’s picture

Status: Closed (fixed) » Active

Hmm it appears that this didn't completely work. @blackundertone reported in Github that the same issue still exists: https://github.com/farmOS/farm_asset/issues/1

I'm reopening this while I debug further...

m.stenta’s picture

m.stenta’s picture

Status: Active » Fixed

Interesting ... this actually turned out to be an issue in the Views module.

As I described in #3 above, I changed a setting on the relationship handler for the animal ID tags so that it only joins in the FIRST animal tag. However, there is a bug with the first delta option: #2750453: Delta value 1 not handled

The patch is already committed to Views 7.x-3.x, but has not been included in a release yet, so I'm including the patch in farmOS's drupal-org.make file, and we can remove it when the new version of Views comes out.

Status: Fixed » Closed (fixed)

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

m.stenta’s picture

Project: Farm Livestock » farmOS

Moving old issues to the canonical farmOS project for easier searching. Apologies for email spam if anyone is following these. :-)