Fix get_entity_attributes query to use LEFT JOIN and sort_order

This commit is contained in:
OpenClaw Bot
2026-02-20 00:19:33 +08:00
parent 1833163a95
commit 91b5e4d46a

View File

@@ -767,8 +767,8 @@ class DatabaseManager:
rows = conn.execute(
"""SELECT ea.*, at.name as template_name, at.type as template_type
FROM entity_attributes ea
JOIN attribute_templates at ON ea.template_id = at.id
WHERE ea.entity_id = ? ORDER BY at.display_order""",
LEFT JOIN attribute_templates at ON ea.template_id = at.id
WHERE ea.entity_id = ? ORDER BY ea.created_at""",
(entity_id,)
).fetchall()
conn.close()