TryGhost
OSS
Ghost
Fixed lazy URL primary_tag on tied tag sort_order ref https://linear.app/ghost/issue/HKG-1822 primary_tag is a post's first tag if it is public, so it depends on the order the tags relation returns. The lazy URL path loads tags through the model's tags() relation, which orders by sort_order with no tie-breaker. When several of a post's tags share a sort_order — the state bulk and import operations leave behind — MySQL is free to return them in different orders per query, so the lazy path could resolve a different primary_tag than the eager service and build a different URL for the same post under a {primary_tag} permalink (seen in production as eager serving /disaster-preparedness/ while the serializer produced /claremont-elmwood/). Order tags()/authors() by posts_tags.id / posts_authors.id (attach order) after sort_order. That is the tag the eager service already serves, so the lazy path now matches it without touching eager's own raw-knex query. The pivot id is added to withPivot because the relation query uses DISTINCT, which requires ORDER BY columns to appear in the SELECT list.
nx run ghost-monorepo:lint:boundaries
Sign in / Sign up
Open main menu
Succeeded
CI Pipeline Execution
nx run ghost-monorepo:lint:boundaries
Click to copy
Linux
4 CPU cores
read-write
access token used
fd7e182e
29482