Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #2
m.stentaComment #3
m.stentaLooking 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.
Comment #5
m.stentaI 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."
Comment #6
m.stentaHmm 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...
Comment #7
m.stentaComment #8
m.stentaInteresting ... 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.
Comment #10
m.stentaMoving old issues to the canonical farmOS project for easier searching. Apologies for email spam if anyone is following these. :-)