From 64884b3dc8d84f17bc9bb92a8a69caa3e6f9922d Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Sat, 7 Dec 2019 21:00:36 -0500 Subject: [PATCH] require that the tag not be an alias --- lib/philomena_web/image_loader.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/philomena_web/image_loader.ex b/lib/philomena_web/image_loader.ex index 0b12533f..123d4c40 100644 --- a/lib/philomena_web/image_loader.ex +++ b/lib/philomena_web/image_loader.ex @@ -78,9 +78,10 @@ defmodule PhilomenaWeb.ImageLoader do Tag |> join(:left, [t], at in Tag, on: t.id == at.aliased_tag_id) |> where([t, at], t.name in ^tags or at.name in ^tags) - |> preload([:aliases, :implied_tags, :implied_by_tags, :dnp_entries, public_links: :user]) + |> preload([:aliases, :aliased_tag, :implied_tags, :implied_by_tags, :dnp_entries, public_links: :user]) |> Repo.all() |> Enum.uniq_by(& &1.id) + |> Enum.filter(&is_nil(&1.aliased_tag)) end defp render_bodies([], _conn), do: []