word: missing images in translations
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 5 Jun 2022 23:24:40 +0000 (01:24 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 11 Jul 2022 02:02:34 +0000 (04:02 +0200)
tools/word.pg.sql

index 69ae03c0a071aea553d41846f1bc12278dc6d544..6647370b1d2c3a17994209ffec05cf3db01ee3c0 100644 (file)
@@ -74,7 +74,8 @@ CREATE OR REPLACE VIEW _word_ref AS
                coalesce(r.wptitle, w.wptitle) wptitle,
                coalesce(r.story,   w.story  ) story,
                r.creator, r.created, r.updated,
-               CASE WHEN r.image IS NULL THEN w.id ELSE r.id END id -- image id
+               CASE WHEN nullif(r.image, '{}') IS NOT NULL THEN r.id
+                    WHEN nullif(w.image, '{}') IS NOT NULL THEN w.id END id -- image id
        FROM word r
        LEFT JOIN word w ON w.id = r.ref;